Re: Discounts

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 36554
interpreted = N
texte = Nitai @ ComputerOil wrote: > > Hi all, > > I have 3 discounts stored for each item in the products.db. > > Getting the discount out of the products.db is no problem within a lineitems > context. I do a lookup with quantity and get the desired discount...BUT... > > Let say I have a items and the customer buys 20 pieces. In the products.db > the discount for 20 pieces is stored with 10%. I get this discount out but I > also get the discount for 10 pieces which is 5%. How can I only get the > discount out for 20 pieces? > > Here is the code I have used so far: > > [if (([quantity]=5) | ([quantity]>5))]is 20 > 5?> [then] > You get 10% > [/then] > > [if (([quantity]=10) | ([quantity]>10))]is 20 > 10?> [then] > You get 15% > [/then] > > [if (([quantity]=20) | ([quantity]>20))]is 20 = 20?> You get 20% > [/then] > > [/if] > > [/if] > > [/if]The point is that each of these [if] statements is independent of the others. If you want to use [if] then you need to nest the 2nd two [if] statements so that only one fires.[if...] [else] [if...] [else] [if...] [/if] [/else] [/if] [/else] [/if]HTHJohn Peacock-- 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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Discounts: Buy One, Get One =?ISO-8859-1?Q?99=A2?= ( Clint Davis 2004)
  2. Re: Discounts: Buy One, Get One =?ISO-8859-1?Q?99=A2?= ( Donovan Brooke 2004)
  3. Re: Discounts: Buy One, Get One =?ISO-8859-1?Q?99=A2?= ( Clint Davis 2004)
  4. Re: Discounts: Buy One, Get One =?ISO-8859-1?Q?99=A2?= ( Donovan Brooke 2004)
  5. Re: Discounts: Buy One, Get One =?ISO-8859-1?Q?99=A2?= ( Clint Davis 2004)
  6. Re: Discounts: Buy One, Get One =?ISO-8859-1?Q?99=A2?= ( Donovan Brooke 2004)
  7. Discounts: Buy One, Get One =?ISO-8859-1?Q?99=A2?= ( Clint Davis 2004)
  8. Re: Discounts ( John Peacock 2004)
  9. Re: Discounts (Donovan 2002)
  10. Re: Discounts (Clint Davis 2002)
  11. Re: Discounts (Donovan 2002)
  12. Re: Discounts (Jay Van Vark 2002)
  13. Discounts (Clint Davis 2002)
  14. Re: Discounts (John Peacock 2001)
  15. Re: Discounts (Rob Marquardt 2001)
  16. Re: Need help with Shipping/Price discounts (PCS Technical Support 1998)
  17. Need help with Shipping/Price discounts (bradeisenberg@iname.com 1998)
  18. Re: Discounts (PCS Technical Support 1998)
  19. Discounts (greg 1998)
  20. Re: Secure Server not remembering discounts (Grant Hulbert 1998)
  21. Secure Server not remembering discounts (Christine Crane 1998)
  22. Re: Tracking inbound links for discounts (Olin 1997)
  23. Tracking inbound links for discounts (Gil Poulsen 1997)
  24. Re: .. more on sliding discounts... (Jeremy Pocock 1997)
  25. Re: .. more on sliding discounts... (Grant Hulbert 1997)
  26. .. more on sliding discounts... (Jeremy Pocock 1997)
  27. Applying discounts as more items are added... (Jeremy Pocock 1997)
Nitai @ ComputerOil wrote: > > Hi all, > > I have 3 discounts stored for each item in the products.db. > > Getting the discount out of the products.db is no problem within a lineitems > context. I do a lookup with quantity and get the desired discount...BUT... > > Let say I have a items and the customer buys 20 pieces. In the products.db > the discount for 20 pieces is stored with 10%. I get this discount out but I > also get the discount for 10 pieces which is 5%. How can I only get the > discount out for 20 pieces? > > Here is the code I have used so far: > > [if (([quantity]=5) | ([quantity]>5))]is 20 > 5?> [then] > You get 10% > [/then] > > [if (([quantity]=10) | ([quantity]>10))]is 20 > 10?> [then] > You get 15% > [/then] > > [if (([quantity]=20) | ([quantity]>20))]is 20 = 20?> You get 20% > [/then] > > [/if] > > [/if] > > [/if]The point is that each of these [if] statements is independent of the others. If you want to use [if] then you need to nest the 2nd two [if] statements so that only one fires.[if...] [else] [if...] [else] [if...] [/if] [/else] [/if] [/else] [/if]HTHJohn Peacock-- 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://search.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:

A Global Variable (1997) [WebDNA] Interesting Trigger issue (2020) Parsing overhead for commenting out line endings (2003) How true is this? (1999) WebDNA dying or ... ? (2005) [Fwd: Rotating Banners ... (was LinkExchange)] (1997) [OT] JS Libraries (2007) Kill the webcat process (2000) Use of Back and Reload Buttons on ShoppingCart page? (1997) SSL and Webstar 3 with Webcatalog (1998) b12 cannot limit records returned and more. (1997) [OT] Don't have a mac to test on? (2004) RE: creating writefile data from a nested search (1997) Can GMT be called from the OS ? (2004) AppleScript error (2003) Emailer help....! (1997) Removing [showif] makes a big difference in speed (1997) WebMerchant 3.0 for Mac shipping now (1998) Problem displaying search result (1997) CommandSecurity? (1997)