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 now it's not. Here's how shipping on the site I'm working on should work: people are charged a flat rate depending on which mode of shipping is selected, + $2 for each additional item. They are charged $0 for downloadable items, so if only DLable items are selected, 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 unitshipcost of $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 each item's unitshipcost to a math variable...[lineitems] ... [math show=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][setheader cart=[cart]]shipcost=[math][lookup db=admin/shippers.db&lookinfield=SHR_ID&value=[shipVia]&returnfield=SHR_AMT]-2[/math][/setheader][/showif][!] if it's equal to zero, all ordered items are DLable, and I want to zero out shipcost[/!] [showif totunitship=0][setheader cart=[cart]]shipcost=0[/setheader][/showif] The problem: on my invoice.tpl, [shippingtotal] (which is supposed to equal shipcost+(unitshipcost for each item)) is still turning out equal to the base value in shippers.db minus $2, as if the first instance above is being calculated even though totunitship=0.I've searched my docs and I can't find anyplace else I might be setting that amount.Any ideas where I should look next or what I might be doing wrong, or how I might discover what I'm doing wrong?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:

    
  1. Re: Zeroing out shipping costs (Sam Lewis 2000)
  2. Re: Zeroing out shipping costs (Chris Vargas 2000)
  3. Re: Zeroing out shipping costs (Sam Lewis 2000)
  4. Zeroing out shipping costs (Chris Vargas 2000)
I thought I had this working at one point, but now it's not. Here's how shipping on the site I'm working on should work: people are charged a flat rate depending on which mode of shipping is selected, + $2 for each additional item. They are charged $0 for downloadable items, so if only DLable items are selected, 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 unitshipcost of $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 each item's unitshipcost to a math variable...[lineitems] ... [math show=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][setheader cart=[cart]]shipcost=[math][lookup db=admin/shippers.db&lookinfield=SHR_ID&value=[shipVia]&returnfield=SHR_AMT]-2[/math][/setheader][/showif][!] if it's equal to zero, all ordered items are DLable, and I want to zero out shipcost[/!] [showif totunitship=0][setheader cart=[cart]]shipcost=0[/setheader][/showif] The problem: on my invoice.tpl, [shippingtotal] (which is supposed to equal shipcost+(unitshipcost for each item)) is still turning out equal to the base value in shippers.db minus $2, as if the first instance above is being calculated even though totunitship=0.I've searched my docs and I can't find anyplace else I might be setting that amount.Any ideas where I should look next or what I might be doing wrong, or how I might discover what I'm doing wrong?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)