numero = 10781
interpreted = N
texte = In our setup we use the unitShipCost as a partial sum reflecting the mailing weight for each (item type * quantity) of order in the cart. We calculate this via a hidden input field in the invoice.tmpl. For some reason I couldn't get this to work via the formulas database. I used the same formula that it is in the value= string below.Now, I want to summate that field and use the resultant sum as an associative lookup in our countries database to determine the [shipCost] total. The countries database has the following fields: Country Group_Code half_lb one_lb two_lb three_lb four_lb five_lb addl_lbQUESTIONS:1) Would I get the total weight via [unitShipCostsumm=T] ?2) Assuming 1) if that total was 3.4 lbs. I would want to lookup under four_lb field for whatever country the shipping address was. How do you do an indexing type of lookup on a database field given one of the fields (country) is used as a lookup? e.g.My lookup algorithm is something like?[showif [unitShipCostsumm=T]<=5]][lookup db=countries.db?lookinfield=Country&value=[shiptocountry]&returnfield=[index_to_field(ciel([unitShipostsumm=T])+3]][/showif][showif [unitShipCostsumm=T]>5][lookup db=countries.db?lookinfield=Country&value=[shiptocountry]&returnfield=[five_lb]+(([unitShipCostsumm=T] - 5) * [addl_lb]]][/showif]The other showif is if the total weight is over 5 lbs. Or do I have to do a whole bunch of showif tests for each case? Am I on the right track?Thanks for any help!Curt----------------------------------------------------------------------| William Curt Eggemeyer Curt@mail.bzzzzzz.com || BeeHive Technologies, Inc. || http://www.bzzzzzz.com with a WebCam in Pasadena, California |----------------------------------------------------------------------
Associated Messages, from the most recent to the oldest:
In our setup we use the unitShipCost as a partial sum reflecting the mailing weight for each (item type * quantity) of order in the cart. We calculate this via a hidden input field in the invoice.tmpl. For some reason I couldn't get this to work via the formulas database. I used the same formula that it is in the value= string below.[math][lookup db=catalog.txt&lookInField=sku&value=[sku]&returnField=weight]*[quantity][/math]>Now, I want to summate that field and use the resultant sum as an associative lookup in our countries database to determine the [shipCost] total. The countries database has the following fields: Country Group_Code half_lb one_lb two_lb three_lb four_lb five_lb addl_lbQUESTIONS:1) Would I get the total weight via [unitShipCostsumm=T] ?2) Assuming 1) if that total was 3.4 lbs. I would want to lookup under four_lb field for whatever country the shipping address was. How do you do an indexing type of lookup on a database field given one of the fields (country) is used as a lookup? e.g.My lookup algorithm is something like?[showif [unitShipCostsumm=T]<=5]][lookup db=countries.db?lookinfield=Country&value=[shiptocountry]&returnfield=[index_to_field(ciel([unitShipostsumm=T])+3]][/showif][showif [unitShipCostsumm=T]>5][lookup db=countries.db?lookinfield=Country&value=[shiptocountry]&returnfield=[five_lb]+(([unitShipCostsumm=T] - 5) * [addl_lb]]][/showif]The other showif is if the total weight is over 5 lbs. Or do I have to do a whole bunch of showif tests for each case? Am I on the right track?Thanks for any help!Curt----------------------------------------------------------------------| William Curt Eggemeyer Curt@mail.bzzzzzz.com || BeeHive Technologies, Inc. || http://www.bzzzzzz.com with a WebCam in Pasadena, California |----------------------------------------------------------------------
w curt eggemeyer
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...