Cumulative Shipping charge calculations - your help please.

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 13797
interpreted = N
texte = Per your suggestion we tried to do a lineitem loop. As before we get the handling charge(unitshipcost) from the catalog.txt database * lineitem qty to calculate ok. But we are not able to add up the total quantity of items purchased and multiply it time the lookup value from the shipcost.db database to have and cumulative total. Shipping & handling total = (sum(lineitem qty * lineitem handling)) + (sum(lineitem qty)) * shipping charge). Here is the code we wrote in the formula.dbName Formula shipCost [lineItems][/lineItems][math][lookup db=ShipCosts.db&lookInField=ShipMethod&value=[shipVia]&returnField=SHIPCOST] *[totalqty][/math] unitShipCost [lookup db=bushelcatalog.txt&lookInField=sku&value=[sku]&returnField=UNITSHIPCOST] Shipcost.db contentShipMethod ShipCost VANCOUVER 0.00 CLARKCOUNTY 5.00 UPSGROUND 8.95 UPS2NDDAY 18.95 UPSNEXTDAY 28.95Your advice and guidance is appreciated.Virtualrep Associated Messages, from the most recent to the oldest:

    
  1. Cumulative Shipping charge calculations - your help please. (updates@virtualrep.com (Updates) 1997)
Per your suggestion we tried to do a lineitem loop. As before we get the handling charge(unitshipcost) from the catalog.txt database * lineitem qty to calculate ok. But we are not able to add up the total quantity of items purchased and multiply it time the lookup value from the shipcost.db database to have and cumulative total. Shipping & handling total = (sum(lineitem qty * lineitem handling)) + (sum(lineitem qty)) * shipping charge). Here is the code we wrote in the formula.dbName Formula shipCost [math]totalqty=0[/math]>[lineitems][math]totalqty=totalqty+[quantity][/m ath]>[/lineItems][math][lookup db=ShipCosts.db&lookInField=ShipMethod&value=[shipVia]&returnField=SHIPCOST] *[totalqty][/math] unitShipCost [lookup db=bushelcatalog.txt&lookInField=sku&value=[sku]&returnField=UNITSHIPCOST] Shipcost.db contentShipMethod ShipCost VANCOUVER 0.00 CLARKCOUNTY 5.00 UPSGROUND 8.95 UPS2NDDAY 18.95 UPSNEXTDAY 28.95Your advice and guidance is appreciated.Virtualrep updates@virtualrep.com (Updates)

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:

multi-paragraph fields (1997) [WebDNA] Feature requests - date format (2009) [WebDNA] WebDNA Showcase? (2008) Intermitent problem using [referrer] (1997) Preserving file creation dates on [copyfile] (2007) Drop Down Menus (2002) What would be sweet is (2003) no global [username] or [password] displayed ... (1997) problems with 2 tags (1997) [WebDNA] mod_WebDNA_apache2.2.so: mach-0, but wrong architecture (2010) strange math (2004) Search inside Include (1998) WC2b15 File Corruption (1997) Date search - yes or no (1997) ie Posting error (2000) Yet another db manager (2003) Practice runs ? (1997) presetting variables ... (2000) is 'template' a reserved webcat tag? (2000) [WebDNA] SOAP support (2014)