Re: Tabled Discount

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 51422
interpreted = N
texte = stephen wrote: > If I have an item whose price is $4.00 each if user buys 1-4 and $3.00 > each if user buys 5-10 and $2.75 each if they buy case of 12. > Price database: SKUMAXQTYPRICE 111144 1111103 1111122.75 11111442 then in the formulas.db, have an entry for price that selects the correct price based on what they ordered. I'm too tired to work the search out right now, but use exact match on SKU, le match on MAXQTY, sort ascending by MAXQTY, and return only 1 record. This means you can have as many price breaks as you want (like the gross qty line I added above), without having to add any code. WARNING: the formulas.db is only accessed when the item is first added to the cart. If your site permits them to edit the cart later, make sure you add logic so if they change the quantity, the price is recalculated. One way to do this is to store the actual formula in an include file and just reference it in the formulas.db (so you can reuse the same logic elsewhere). HTH John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748 ------------------------------------------------------------- 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: Tabled Discount ( John Peacock 2003)
  2. Re: Tabled Discount ( Donovan 2003)
stephen wrote: > If I have an item whose price is $4.00 each if user buys 1-4 and $3.00 > each if user buys 5-10 and $2.75 each if they buy case of 12. > Price database: SKUMAXQTYPRICE 111144 1111103 1111122.75 11111442 then in the formulas.db, have an entry for price that selects the correct price based on what they ordered. I'm too tired to work the search out right now, but use exact match on SKU, le match on MAXQTY, sort ascending by MAXQTY, and return only 1 record. This means you can have as many price breaks as you want (like the gross qty line I added above), without having to add any code. WARNING: the formulas.db is only accessed when the item is first added to the cart. If your site permits them to edit the cart later, make sure you add logic so if they change the quantity, the price is recalculated. One way to do this is to store the actual formula in an include file and just reference it in the formulas.db (so you can reuse the same logic elsewhere). HTH John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748 ------------------------------------------------------------- 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:

Installed 4.5 but indicates 4.50rc2 (2002) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) docs for WebCatalog2 (1997) PSC recommends what date format yr 2000??? (1997) can WC render sites out? (1997) Document Contains No Data (1998) [input] questions (1997) [shippingtotal] & Formulas.db prob (2003) Online reference (1997) shipCost not working v2.1b4 (1997) RE: Help name our technology! (1997) Solution help needed (1998) Not really WebCat (1997) temporary database? (2000) Progress !! WAS: Trouble with formula.db (1997) Summing fields (1997) Misc Stuff That Might Help (1997) woops - speed results - right subject (2002) multiple db's (2003) PSC recommends what date format yr 2000??? (1997)