Zeroing out shipping costs
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 26466
interpreted = N
texte = I thought I had this working at one point, but nowit's not. Here's how shipping on the site I'm workingon should work: people are charged a flat ratedepending on which mode of shipping is selected, + $2for each additional item. They are charged $0 fordownloadable items, so if only DLable items areselected, shippingcharge should be $0.I'm doing the following:* the base shipping cost of the shipping mode selected(Ground, 2nd day, overnight, etc.) is in shippers.db* products in products.db either have a unitshipcostof $2 (shippable) or $0 (downloadable)* I have no formulas.db* at the point where I'm setting header items, in an[orderfile] context, I do a [lineitems] and total eachitem's unitshipcost to a math variable...[lineitems]...[mathshow=F]totunitship=totunitship+[unitshipcost][/math][/lineitems]* I then do the following:[!] if my variable is >0, there are shippable items,and I need to look up the base shipping cost, minus$2[\!][showif totunitship>0][setheadercart=[cart]]shipcost=[math][lookupdb=admin/shippers.db&lookinfield=SHR_ID&value=[shipVia]&returnfield=SHR_AMT]-2[/math][/setheader][/showif][!] if it's equal to zero, all ordered items areDLable, and I want to zero out shipcost[/!][showif totunitship=0][setheadercart=[cart]]shipcost=0[/setheader][/showif] The problem: on my invoice.tpl, [shippingtotal] (whichis supposed to equal shipcost+(unitshipcost for eachitem)) is still turning out equal to the base value inshippers.db minus $2, as if the first instance aboveis being calculated even though totunitship=0.I've searched my docs and I can't find anyplace else Imight be setting that amount.Any ideas where I should look next or what I might bedoing wrong, or how I might discover what I'm doingwrong?Thanks as always...__________________________________________________Do You Yahoo!?Talk to your friends online with Yahoo! Messenger.http://im.yahoo.com-------------------------------------------------------------Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server.To end your Mail problems go to
.This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Associated Messages, from the most recent to the oldest:
I thought I had this working at one point, but nowit's not. Here's how shipping on the site I'm workingon should work: people are charged a flat ratedepending on which mode of shipping is selected, + $2for each additional item. They are charged $0 fordownloadable items, so if only DLable items areselected, shippingcharge should be $0.I'm doing the following:* the base shipping cost of the shipping mode selected(Ground, 2nd day, overnight, etc.) is in shippers.db* products in products.db either have a unitshipcostof $2 (shippable) or $0 (downloadable)* I have no formulas.db* at the point where I'm setting header items, in an[orderfile] context, I do a [lineitems] and total eachitem's unitshipcost to a math variable...[lineitems]...[mathshow=F]totunitship=totunitship+[unitshipcost][/math][/lineitems]* I then do the following:[!] if my variable is >0, there are shippable items,and I need to look up the base shipping cost, minus$2[\!][showif totunitship>0][setheadercart=[cart]]shipcost=[math][lookupdb=admin/shippers.db&lookinfield=SHR_ID&value=[shipVia]&returnfield=SHR_AMT]-2[/math][/setheader][/showif][!] if it's equal to zero, all ordered items areDLable, and I want to zero out shipcost[/!][showif totunitship=0][setheadercart=[cart]]shipcost=0[/setheader][/showif] The problem: on my invoice.tpl, [shippingtotal] (whichis supposed to equal shipcost+(unitshipcost for eachitem)) is still turning out equal to the base value inshippers.db minus $2, as if the first instance aboveis being calculated even though totunitship=0.I've searched my docs and I can't find anyplace else Imight be setting that amount.Any ideas where I should look next or what I might bedoing wrong, or how I might discover what I'm doingwrong?Thanks as always...__________________________________________________Do You Yahoo!?Talk to your friends online with Yahoo! Messenger.http://im.yahoo.com-------------------------------------------------------------Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server.To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Chris Vargas
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:
[WebDNA] CMS in WEBDNA (2009)
password authentication schemes (2003)
Large File Uploads Impact WebDNA Performance (IIS) (2003)
date formatting for CC card expiration date check (1998)
Summing fields (1997)
Another question about credit cards (1997)
Click-through/Referral tracking solution needed (2000)
whole word matching (2004)
Purchase Plugin Missing (1996)
WebCat2b13MacPlugIn - syntax to convert date (1997)
WebCat editing, SiteGuard & SiteEdit (1997)
setting HTTP response header (1998)
Error Messages Returned to User (1997)
AcountAutherizer (2002)
Separate SSL Server (1997)
File Upload (1997)
Error Log.db --however (1997)
Not really WebCat (1997)
Using the new syntax/scoping methods (2000)
Problem with ShoppingCart.tpl refresh (2000)