I know im either overlooking something or i just have no clue. 

I have a shopping cart that has options pricing in it, and im having a
hard time getting the prices of all the options to add up. The option
IDs are in a ^ delimited list. I need to match the id to the price of
the option in another table. I can do this fine, but i cant seem to loop
through and add all the option prices for a sub total.

so how do i get it to add up?

Thanks for any help.

<cfset TotalOptPrice = 0>
     
     <!--- Find how many options are added to this product, if any
     <cfloop index="pricenum" from="1" to="#ListLen(Options, "^")#">
     
                <!--- Set variable to option price --->
     <cfset CurrentOptionPrice = #ListGetAt(OptionPrice, PriceNum,
"^")#>
     <cfset TotalOptPrice = (#TotalOptPrice# + #CurrentOptionPrice#)>
     
                </cfloop> 


This gives me only the last option price since totaloptprice is being
overwritten again and again.  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to