Shopping cart
Posted: Thu Jul 23, 2009 5:41 pm
can anybody help me with some scrypt?
Im working on a simple shopping cart for my application and am using the following code:
I want to add a seperate field that calculates the grand total. So far the code works out the total for each line and displays it in the table field but what code could i use that calculates all of the lines and displays the total in a seperate field? I'm very close in throwing my laptop out the window! lol
Your help would be most appreciated.
Daniel
Im working on a simple shopping cart for my application and am using the following code:
Code: Select all
on mouseUp
put the hilitedLines of field "ItemsOnOffer" into theLines
repeat for each line tLine in theLines
set numberformat to 0.00
put line tLine of field "ItemsOnOffer" into tDesc
put field "QuantitySelected" into tQty
put field "ItemValue" into tItemPrice
put tQty * tItemPrice into tLineTotal
put tDesc & tab & tab & tQty & tab & tItemPrice & tab & tLineTotal & cr after field "cart" stack "accessory selections"
put "" into field "Quantityselected"
put "" into field "itemvalue"
--format the prices for neatness, but your item justification is a bit limited in a list field anyway
end repeat
end mouseUp
Your help would be most appreciated.
Daniel