Re: Another option
This WebDNA talk-list message is from 2005
It keeps the original formatting.
numero = 63279
interpreted = N
texte = You could set a [math] variable for each lineitem with the price ascalculated below, then total those [math] variables at the end of the[lineitems] loop. Try this:[!] display line items [/!][lineitems][math]item[index]=[TextE]*[quantity]*[price][/math][/lineitems][!] display lineitems total [/!][loop start=1&end=[numlineitems]][math]itemsTotal=itemsTotal+item[index][/math][/loop]On 10/25/05 2:35 PM, "paul"
wrote:> Yes the code works to a point> > it gives me the correct price of each item but I need to find a way of> totalling them, if I have 4 items in the cart it shows the 4 prices as I> need them but> > Cannot work out the code for that, I need to add up the list of these not> just display them> > Help needed!!> > Thanks> paul> > > ----- Original Message -----> From: "Clint Davis" > To: "WebDNA Talk" > Sent: Tuesday, October 25, 2005 9:19 PM> Subject: Re: Another option> > >> As long as you're inside an [orderfile] and [lineitems] loop, the math you>> have below should work.>> >> >> On 10/25/05 1:11 PM, "paul" wrote:>> >>> How can I just add up the contents of my shopping cart based on the>>> following>>> >>> Each items price is calculated by> [math][TextE]*[quantity]*[price][/math]>>> >>> I just need to add these together for each line in the cart, I can list> them>>> but do not seem to be able to add them up>>> >>> How do I do this-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
You could set a [math] variable for each lineitem with the price ascalculated below, then total those [math] variables at the end of the[lineitems] loop. Try this:[!] display line items [/!][lineitems][math]item[index]=[TextE]*[quantity]*[price][/math][/lineitems][!] display lineitems total [/!][loop start=1&end=[numlineitems]][math]itemsTotal=itemsTotal+item[index][/math][/loop]On 10/25/05 2:35 PM, "paul" wrote:> Yes the code works to a point> > it gives me the correct price of each item but I need to find a way of> totalling them, if I have 4 items in the cart it shows the 4 prices as I> need them but> > Cannot work out the code for that, I need to add up the list of these not> just display them> > Help needed!!> > Thanks> paul> > > ----- Original Message -----> From: "Clint Davis" > To: "WebDNA Talk" > Sent: Tuesday, October 25, 2005 9:19 PM> Subject: Re: Another option> > >> As long as you're inside an [orderfile] and [lineitems] loop, the math you>> have below should work.>> >> >> On 10/25/05 1:11 PM, "paul" wrote:>> >>> How can I just add up the contents of my shopping cart based on the>>> following>>> >>> Each items price is calculated by> [math][TextE]*[quantity]*[price][/math]>>> >>> I just need to add these together for each line in the cart, I can list> them>>> but do not seem to be able to add them up>>> >>> How do I do this-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Clint Davis
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
[ConvertChars] problem (1997)
Date search - yes or no (1997)
Hiding HTML and page breaks (1997)
Bug Report, maybe (1997)
Tab Charactor (1997)
CHMOD recursive for directories (2006)
WC2b15 File Corruption (1997)
MSSQL - ODBC - OSX (2005)
Where is f2? (1997)
Modifying Carts (1999)
[protect] is protecting too much!!! (2000)
Image Upload and Auto Resize? (2003)
Generating Report Totals (1997)
looking for developers with solutions (2000)
SmithMicro Help! -- Can't access WebCatalog Admin! (2001)
Carts? (1998)
Quit revisited (1997)
[WebDNA] Copy a whole row from a db to another db or table (2017)
cybercash (2002)
problems with 2 tags (1997)