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 theothers.  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 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://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
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 theothers.  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 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://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:
 
Attention all list readers (1997)
 
Pipes instead of tabs (1998)
 
Re:Help name our technology! (1997)
 
Re:2nd WebCatalog2 Feature Request (1996)
 
WebCat2final1 crashes (1997)
 
Running 2 two WebCatalog.acgi's (1996)
 
Personal Web Server (1998)
 
this works sometimes and sometimes not (1997)
 
StandardConversions.db (1998)
 
WebCatalog/WebMerchant 2.1 (1998)
 
Extended [ConvertChars] (1997)
 
LookUp Tag (1997)
 
[WebDNA] site becomes unavailable and WebCatalog warnings (2017)
 
Re[2]: HELP: OS X Problem...  (2000)
 
Did you hear about this? (1997)
 
[WebDNA] Formatting numbers - truncation instead of rounding (2011)
 
 form validator issue (2005)
 
Configuring E-mail (1997)
 
[WebDNA] Dates (2009)
 
SET (1998)