[ic] Adding variables

Chad Wittrock interchange-users@interchange.redhat.com
Thu Sep 6 15:23:00 2001


I am attempting to add two variable on my checkout page and don't seem to be
getting it right.

I found a thread that had some relevance to this at:
http://developer2.akopia.com/archive/interchange-users/1998-old/1040.html

There is some code there that adds two variables
	[set name="ReceiptTotal" interpolate=1][[calc][scratch
	DeliveryCharge]+[total-cost][/calc]][/set]

I did something very similiar to this:

<snip>
	<TD ALIGN=RIGHT><font face="sans-serif">
	              [set total_shipping]0[/set]
		[item-list]
         			[seti total_shipping][calc]
                 		[scratch total_shipping] + ([item-field shipping] *
[item-quantity])
         			[/calc][/seti]
		[/item-list]

		[currency][scratch total_shipping][/currency]
	</TD>
</TR>
<TR>
	<TD ALIGN=RIGHT width="350"><font face="sans-serif">TOTAL: </font></TD>

	[set cart_total][calc][scratch total_shipping]+[subtotal][/calc][/set]

	<TD ALIGN=RIGHT><font face="sans-serif">[currency][scratch
cart_total][/currency]</TD>

When I do the calc on cart_total I end up with zero. I followed the example
exactly, I thought. Does someone see something I don't or am I going about
this wrong?

Any help would be appreciated.
Chad

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            ____
  |  | |\ |  ||   Chad M. Wittrock (Chad.Wittrock@uni.edu)
  \__/ | \| _||_  University of Northern Iowa