Re: [shippingtotal] Fixed...

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 45759
interpreted = N
texte = D'oh!Just had to add this on the template after all the [setlineitems] and such, and changed Formulas.db back to the standard shipping equation:[math show=f]ordered=0[/math] [orderfile ShoppingCarts/[GetCookie SessionID]] [lineitems][math show=f]ordered=[ordered]+[quantity][/math][/lineitems][/orderfile] [showif [ordered]=1][setheader cart=[GetCookie SessionID]&db=catalog.db]shippingTotal=6.50[/setheader][/showif] [showif [ordered]>1][setheader cart=[GetCookie SessionID]&db=catalog.db]shippingTotal=0.00[/setheader][/showif]Thanks a trillion, John!Thanks too Donovan...!You've saved Christmas!-WillOn Wednesday, November 27, 2002, at 09:15 AM, John Peacock wrote:> WJ Starck wrote: >> Now, the million dollar question: >> 1) How can I use the above in Formulas.db to properly calculate the >> shipping charges? > > You cannot affect existing line items, unless you delete the lines and > readd them. Formulas.db only fires upon [addlineitem] context (or > ?command=add but you should really use the context). > >> 2) Can I somehow override the shipping cost calculated in Formulas.db >> with the above WebDNA in a template? > > Use a [lineitems] loop and [setlineitem] (with a password) to alter > the individual lines. Use a [setheader] to alter the header ShipCost > field itself. My preferred method is to always use contexts to add > line items at the top of the target page (which may very well be the > cart page itself), so I can preprocess the lines anywhich way I want. > I can add hidden lineitems (for a discount for example) or walk the > lines and delete/alter existing items. > > Since you have such a simple shipping scheme, I would just use the > header and set all of the line items unitshipcost to 0. Just have a > loop at the top of the cart page which loops through the line items > and updates the shipcost header field accordingly. > > HTH > > John > > -- > John Peacock > Director of Information Research and Technology > Rowman & Littlefield Publishing Group > 4720 Boston Way > Lanham, MD 20706 > 301-459-3366 x.5010 > fax 301-429-5747 > > > ------------------------------------------------------------- > 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 > > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: [shippingtotal] Fixed... (WJ Starck 2002)
D'oh!Just had to add this on the template after all the [setlineitems] and such, and changed formulas.db back to the standard shipping equation:[math show=f]ordered=0[/math] [orderfile ShoppingCarts/[GetCookie SessionID]] [lineitems][math show=f]ordered=[ordered]+[quantity][/math][/lineitems][/orderfile] [showif [ordered]=1][setheader cart=[GetCookie SessionID]&db=catalog.db]shippingTotal=6.50[/setheader][/showif] [showif [ordered]>1][setheader cart=[GetCookie SessionID]&db=catalog.db]shippingTotal=0.00[/setheader][/showif]Thanks a trillion, John!Thanks too Donovan...!You've saved Christmas!-WillOn Wednesday, November 27, 2002, at 09:15 AM, John Peacock wrote:> WJ Starck wrote: >> Now, the million dollar question: >> 1) How can I use the above in formulas.db to properly calculate the >> shipping charges? > > You cannot affect existing line items, unless you delete the lines and > readd them. formulas.db only fires upon [addlineitem] context (or > ?command=add but you should really use the context). > >> 2) Can I somehow override the shipping cost calculated in formulas.db >> with the above WebDNA in a template? > > Use a [lineitems] loop and [setlineitem] (with a password) to alter > the individual lines. Use a [setheader] to alter the header ShipCost > field itself. My preferred method is to always use contexts to add > line items at the top of the target page (which may very well be the > cart page itself), so I can preprocess the lines anywhich way I want. > I can add hidden lineitems (for a discount for example) or walk the > lines and delete/alter existing items. > > Since you have such a simple shipping scheme, I would just use the > header and set all of the line items unitshipcost to 0. Just have a > loop at the top of the cart page which loops through the line items > and updates the shipcost header field accordingly. > > HTH > > John > > -- > John Peacock > Director of Information Research and Technology > Rowman & Littlefield Publishing Group > 4720 Boston Way > Lanham, MD 20706 > 301-459-3366 x.5010 > fax 301-429-5747 > > > ------------------------------------------------------------- > 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 > > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/ WJ Starck

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:

Quick ShowIf question (1997) won't serve .tpl (2000) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) Help name our technology! (1997) OT JavaScript question (1999) .html processing? (1998) Quit revisited (1997) Re2: AAgghh!! Help, please. SSL strikes again. (1997) Plugin or CGI or both (1997) Sorry But This seems to be my fate (2000) Nested tags count question (1997) FEW QUESTIONS (1997) Looking for a Manual (1997) RE: Upload (1998) New install permissions (2003) More on the email templates (1997) WebDNA Mail issues (2002) WC2f3 (1997) Off-Topic: Optimal WebSTAR settings for WebDNA plugin v4.5 (2002) Re:Running 2 two WebCatalog.acgi's (1996)