Re: Discounts: Buy One, Get One =?ISO-8859-1?Q?99=A2?=

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 55447
interpreted = N
texte = On 1/12/04 3:46 PM, "Donovan Brooke" wrote: > Clint Davis wrote: >=20 >> Can I use [SetLineItem] to change the price of the second book to 99=A2 if >> they have the proper promo code and no other 99=A2 item(s)? >=20 > Yes. >=20 > I don't have your products structure but lets say that the discount > applies to all products (books) of a certain category > (won't need this if it is for all products)... >=20 > So after code has been accepted... >=20 > [text]counter=3D0[/text] > [lineitems] > [showif [url][lookup db=3Dproducts.db[!] > [/!]&lookinfield=3DSKU&[!] > [/!]Value=3D[SKU][!] > [/!]&returnfield=3DCATEGORY][/url]=3D[url]BOOK[/url]] >=20 > [text]theindex=3D[lineindex][/text] > [text]counter=3D[math][counter]+1[/math][/text] > [/showif] > [/lineitems] >=20 > [!] This will only change the price of the last lineitem if number (of th= e > category) is greater than one [/!] > [showif [counter]>1] > [setlineitem=20 > cart=3D[cart]&index=3D[theindex]&db=3Dproducts.db]price=3D.99&password=3D= [/set > lineitem] > [/showif] Well, the more I ask the account executive about this, the more complex it gets. Here's the basic structure: 1. Lineitems with quantity greater than one are split into as many lineitem= s as the quantity. 2. Is there more than one lineitem? a. If there is, is there already a discounted item? i. If there is, check out. ii. If there isn't, is the promotion code correct? 1. If it is, change the price of the least expensive item to 99= =A2 and check out. 2. If it isn't, check out. b. If there isn't, is there already a discounted item? i. If there is, reset it's price by doing a [lookup]. ii. If there isn't, check out. ------------------------------------------------------------- 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: 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)
On 1/12/04 3:46 PM, "Donovan Brooke" wrote: > Clint Davis wrote: >=20 >> Can I use [setlineitem] to change the price of the second book to 99=A2 if >> they have the proper promo code and no other 99=A2 item(s)? >=20 > Yes. >=20 > I don't have your products structure but lets say that the discount > applies to all products (books) of a certain category > (won't need this if it is for all products)... >=20 > So after code has been accepted... >=20 > [text]counter=3D0[/text] > [lineitems] > [showif [url][lookup db=3Dproducts.db[!] > [/!]&lookinfield=3DSKU&[!] > [/!]Value=3D[SKU][!] > [/!]&returnfield=3DCATEGORY][/url]=3D[url]BOOK[/url]] >=20 > [text]theindex=3D[lineindex][/text] > [text]counter=3D[math][counter]+1[/math][/text] > [/showif] > [/lineitems] >=20 > [!] This will only change the price of the last lineitem if number (of th= e > category) is greater than one [/!] > [showif [counter]>1] > [setlineitem=20 > cart=3D[cart]&index=3D[theindex]&db=3Dproducts.db]price=3D.99&password=3D= [/set > lineitem] > [/showif] Well, the more I ask the account executive about this, the more complex it gets. Here's the basic structure: 1. Lineitems with quantity greater than one are split into as many lineitem= s as the quantity. 2. Is there more than one lineitem? a. If there is, is there already a discounted item? i. If there is, check out. ii. If there isn't, is the promotion code correct? 1. If it is, change the price of the least expensive item to 99= =A2 and check out. 2. If it isn't, check out. b. If there isn't, is there already a discounted item? i. If there is, reset it's price by doing a [lookup]. ii. If there isn't, check out. ------------------------------------------------------------- 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/ Clint Davis

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:

New public beta available (1997) rotating thumbnails (1997) [WebDNA] Amazon EC2 (2009) Header values are not accepted (1998) Generating unique SKU from [cart] - Still Stumped... (1997) MacAuthorize hub, no modal password dialog? (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Re:no [search] with NT (1997) Stumpted Again (1997) Looking for 24x7 ISP for WebCatalog (1998) WebCat2: Found Items syntax, etc. (1997) b12 cannot limit records returned and more. (1997) Rhapsody? (1997) Trouble with Netscape (1998) MOOOOOO (2000) WC2b15 File Corruption (1997) So many lookers, hey smith micro (2003) Plugin or CGI or both (1997) [Webcat 2]Next (1997) [ConvertChars] problem (1997)