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:

replace using &append=T (2007) Append User DB? (2000) GuestBook example (1997) Solution to truncated email problem! (1998) Quantity discount on some items? (2000) [WebDNA] PHP Array translated to Webdna (2010) Setting up WebCatalog with Retail Pro data (1996) OS X (2000) Sorry WebDNA server not running ????? (2002) WC1.6 to WC2 date formatting (1997) Applescript, WebDNA, and PDF (1997) WebCat2.0 [format thousands .0f] no go (1997) PCS Frames (1997) Emailer setup (1997) Separate SSL Server (1997) WebCatalog 2.0 & WebDNA docs in HTML ... (1997) I think WebDNA-Talk died ... :( (1997) Database Structuring (again) (2003) WebCommerce: Folder organization ? (1997) WebCat and PIXO (2000)