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:

[ShowIf] and empty fields (1997) updating with ProductEditor (1998) Mac 2.1b4 unknown error: BadSuffix (1997) F3 crashing server (1997) Anyone awake? Newby moves deeper! Sitesearch & Customer (2000) using listfiles to build a database? more (2000) The code, one more time. (2003) [AppendFile] problem (WebCat2b13 Mac .acgi) (1997) [SHOWIF] (1997) Anyone awake? Just testing... (2005) How to append text after the sign & (1997) Order not created error (1997) New Calendar Snippet (1998) Separate SSL Server (1997) Here's how to kill a Butler Database. (1997) showcart is slow (1998) Loops and [index] (1998) Nesting format tags (1997) Lineitems not showing up in ThankYou page (2006) using cookies to prevent access (2000)