MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

help with [calc] please



Hello,

Can [calc] be used like I'm trying to use it below?
I'm looping through items in a cart and trying to add their prices so that I
can show the total ([subtotal] doesn't work for me, probably because of a
different db design).
It doesn't really work - I see MV tags where the Total should be.

Is there another/better/proper/working way to do this?

[if items] [then] [item-list]
[sql type=list query="SELECT our_retail_price
FROM product_term WHERE term_id = '[item-code]'"]
	[set our_retail_price][sql-param our_retail_price][/set]

	[set total-price]
		[calc][scratch total-price] + [scratch our_retail_price][/calc]
	[/set]

[/sql]
[/item-list][/then][/if]

Total: [scratch total-price]

Thanks,

Otis
P.S.
I thought I could do it with [perl], but it looks like [perl] stuff always
prints stuff back to the browser, and I want to store the calculation of
Total and print it at the end of the cart, just once. No [perl]?



Search for: Match: Format: Sort by: