RE: Sum of Quantities
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 13085
interpreted = N
texte = Chris ->I am creating a discount structure based on quantity. I have successfully>created the discount for a single line item with a quantity of 8, but I need>to know how to do a sum of all quantities when there is more than one line>item. For example 3 line Items with a quantity of 8 for each giving a total>of 24 products, thus the database search uses 24.Try setting a variable with the [math] context, and adding to it for each [lineitem]. At the top of the page, putthen in each [lineitem], use [math]totalqty=totalqty+[quantity][/math] to add the current quantity to the total. Finally, at the end, you can do whatever you want with the value output by [math]totalqty[/math].I hope this helps,Marc EagleStarNine Technologieshttp://www.smithmicro.com/
Associated Messages, from the most recent to the oldest:
|
- RE: Sum of Quantities (Marc Eagle 1997)
|
Chris ->I am creating a discount structure based on quantity. I have successfully>created the discount for a single line item with a quantity of 8, but I need>to know how to do a sum of all quantities when there is more than one line>item. For example 3 line Items with a quantity of 8 for each giving a total>of 24 products, thus the database search uses 24.Try setting a variable with the
[math] context, and adding to it for each [lineitem]. At the top of the page, put[math]totalqty=0[/math]>then in each [lineitem], use
[math]totalqty=totalqty+[quantity][/math] to add the current quantity to the total. Finally, at the end, you can do whatever you want with the value output by
[math]totalqty[/math].I hope this helps,Marc EagleStarNine Technologieshttp://www.smithmicro.com/
Marc Eagle
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:
RE: Re:Signal Raised (1997)
Help name our technology! (1997)
& in Lookups (1997)
Multiple fields on 1 input (1997)
Erotic Sites (1997)
Re:Help name our technology! (1997)
help needed w/ search params (1998)
[WebDNA] SWITCH/CASE or SHOWIF (2008)
Emailer (1997)
Stopping bad HTML propagation ? (1997)
[Listfiles] vs Netfinder (1997)
Was it something I said??? (1998)
FW: About that math question ... (2003)
Dummy Credit Card Number for debug? (1997)
Random letter and/or number (2001)
converchars in sendmail context.... (2004)
[WebDNA] lists opinion (2009)
WCS Newbie question (1997)
Nested searches (1998)
WebCatalog on OSX and %CPU (2003)