Re: [shippingtotal] still...
This WebDNA talk-list message is from 2002
It keeps the original formatting.
numero = 45757
interpreted = N
texte = 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.HTHJohn-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 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/
Associated Messages, from the most recent to the oldest:
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.HTHJohn-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 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/
John Peacock
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:
Some Questions (1997)
5.0 Pricing (2003)
webcat NT (1998)
Show next 2 examples that work (1997)
Re:No Data (1997)
Help! WebCat2 bug (1997)
[convertChars] and in a textarea on a form (1998)
upgrade? (1997)
Webmerchant 3.08: Help! Error Can't open order file.Ignoring [Orderfile] context (2000)
WebDNA and FTP (2003)
HELP - NONE STOP DIGESTS. Digest for 4/24/97) (1997)
Running 2 two WebCatalog.acgi's (1996)
Post Test (2008)
how to overwrite username and password in the browser? (2000)
[cart]'s ever get recycled? (2000)
POST Datamissing? (1998)
Wanted: More Math Functions (or, Can You Solve This?) (1997)
best practices for long articles (2002)
Nested Loops and SHOWIFs (1997)
[tcpconnect] > SSH? (2002)