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, put 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 Eagle StarNine Technologies http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. 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 Eagle StarNine Technologies http://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:

well sort of - database design (2003) Help with Repost Data msg from form (1997) XMl style syntax (2004) Bug Report, maybe (1997) Repost: WebMerchant crashing and other WebMerchant problem (2000) [WebDNA] maybe silly suggestion? [founditems] (2015) Undocumented changes create problems in webcat 4 ... (2000) displaying New products (using [date]) (1997) Fields/Forms Processing (1998) For those of you not on the WebCatalog Beta... (1997) Tax and ShipCost Problem (1997) Ok here is a question? (1997) Separate SSL Server (1997) WebCommerce: Folder organization ? (1997) Sendmail (1998) Help getting [shownext] to increment (2003) Online reference (1997) Requiring that certain fields be completed (1997) Multiple Merchant Accounts? (1997) Fwd: Problems with Webcatalog Plug-in (1997)