X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Determining Variable for Gift Certificate Total (https://forum.x-cart.com/showthread.php?t=14425)

Joe Schwartz 06-07-2005 04:40 PM

Determining Variable for Gift Certificate Total
 
Does anyone know the variable I can use in cart_contents.tpl that defines the total dollar amount of gift certificates in the cart? I would like to compare it to $cart.subtotal for a particular loop. I'm guessing it's something like $giftcerts.amount, but i can't seem to figure it out. Any help would be greatly appreciated.

Many thanks,

Joe

Joe Schwartz 06-12-2005 08:07 PM

ift Certificate Variable solved
 
The x-cart support help desk provided the answer for me so I thought I would share it here. This code was written to supply a gift certificate subtotal and answers my question.

Code:

{if $cart.giftcerts ne ""}
{assign var="gc_summary_subtotal" value=0}
{section name=giftcert loop=$cart.giftcerts}
{if $cart.giftcerts[giftcert].deleted eq ""}
{assign var="have_giftcerts" value="Y"}
{math equation="x+y" x=$gc_summary_subtotal y=$cart.giftcerts[giftcert].amount assign="gc_summary_subtotal"}
{/if}
{/section}
{if $have_giftcerts eq "Y"}
GiftCertificates Subtotal: {include file="currency.tpl" value=$gc_summary_subtotal}
{/if}
{/if}



All times are GMT -8. The time now is 05:38 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.