calculating shipping costs by a sum of weights

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 24089
interpreted = N
texte = Hi cats :-)using formulas to calculate custom price, taxrate, and a generic shipcost (based on a single ShipTostate user defined input) is pretty clear (I think),but what is not at all clear to me is how to calculate the total shipping costs based on the sum of all weights of all items. I have a UnitShipWeight field in my product database which is the weight in ounces for each record (each sku/item). When we get to the invoice page I need to be able to sum up the weights of all the items in the cart and make that value equal to a variable I want to name totalweight. I want to use totalweight to do a [lookup] in my shippingCosts.db (as part of the formula for shipCost) and return the total shipping charge for the order. (shippngCost.db has the 4 fields: OZweight, prioritymail, globalpriority, and upsground. The values for the latter 3 fields are dollar amounts that increase as the OZweight increases.)Here's my invoice.tpl code:[shipVia] Shipping & Handling $[lookup db=KAS-ShipCosts.db&lookInField=OZWeight&value=[format .0f][totalweight][/format]&returnField=[shipVia]¬Found=47.95]Does anyone know how to do a search on just the items in the cart and sum up their respective UnitShipWeight's so I can get that sum into that [totalweight] spot?Or am I off on an even deeper level?Thanks!-John Butler Associated Messages, from the most recent to the oldest:

    
  1. Re: calculating shipping costs by a sum of weights (Tim Taylor 1999)
  2. calculating shipping costs by a sum of weights (John Butler 1999)
Hi cats :-)using formulas to calculate custom price, taxrate, and a generic shipcost (based on a single ShipTostate user defined input) is pretty clear (I think),but what is not at all clear to me is how to calculate the total shipping costs based on the sum of all weights of all items. I have a UnitShipWeight field in my product database which is the weight in ounces for each record (each sku/item). When we get to the invoice page I need to be able to sum up the weights of all the items in the cart and make that value equal to a variable I want to name totalweight. I want to use totalweight to do a [lookup] in my shippingCosts.db (as part of the formula for shipCost) and return the total shipping charge for the order. (shippngCost.db has the 4 fields: OZweight, prioritymail, globalpriority, and upsground. The values for the latter 3 fields are dollar amounts that increase as the OZweight increases.)Here's my invoice.tpl code:[shipVia] Shipping & Handling $[lookup db=KAS-ShipCosts.db&lookInField=OZWeight&value=[format .0f][totalweight][/format]&returnField=[shipVia]¬Found=47.95]Does anyone know how to do a search on just the items in the cart and sum up their respective UnitShipWeight's so I can get that sum into that [totalweight] spot?Or am I off on an even deeper level?Thanks!-John Butler John Butler

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:

WebCat2b13MacPlugIn - syntax to convert date (1997) PCS Frames (1997) TaxTotal Problem (1997) Announcing general availability of WebDNA 4.5 release (2002) IIS4b2 and WebCatalog b19 (1997) [protect] error page (1997) Help Encrypt/Decrypt eMail (2003) suffix mapping for NT? (1997) Authenticate (1997) How to break a search ... (2002) Adding freight and percentages (2000) [WebDNA] WebDNA on LiveCD ... (2008) Error: Can't open order file. (2005) Using Protection =) (2003) help with autenticate (1998) Sales Tax db (1998) Search and path arguments (1998) Date Bug (1998) Plugin or CGI or both (1997) Re2: frames & carts (1997)