Re: [WebDNA] Shopping cart code debug

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 101942
interpreted = N
texte = Changed the code to the one below, but still the same issue. > ====================================================== > ====================================================== > > [math show=f]SPSubtotal=0[/math] > [text show=f]SPQualify=f[/text] > [text show=f]promoExists=f[/text] > > [lineitems] > [showif [sku]~SP] > [math show=f]SPSubtotal=[SPSubtotal]+([price]*[quantity])[/math] > [/showif] > [/lineitems] > [showif [SPSubtotal]>99] > [text show=f]SPQualify=t[/text] > [/showif] > > [showif [SPQualify]=t] > [lineitems] > [showif [url][sku][/url]=SP133P-PROMO] > [setlineitem > file=^sc/[kart]&index=[lineindex]]quantity=1[/setlineitem] > [!] -- I don't see the value of this ^^^ line. What is If a customer adds more than 1 quantity of the SP133-PROMO, it sets it back to quantity 1. Essentially, we don't want someone to get more than 1 of the promo item. Does that make sense? > it doing that changes something? -- [/!] > [text show=f]promoExists=t[/text] > [/showif] > [/lineitems] > [showif [promoExists]=f] > [addlineitem > file=^sc/[kart]&sku=SP133P-PROMO&db=^db/products.db]quantity=1[/addlineitem] > > [/showif] > [/showif] > > SPQualify=[SPQualify]
> SPSubtotal=[SPSubtotal]
> promoexists=[promoexists]
> > ====================================================== > ====================================================== Ki Song Govinda wrote: > I have to get to my own work just now.. but one thing more jumped out > at me here/now: > see below: > > On Feb 5, 2009, at 1:30 PM, Ki Song wrote: > >> OK. >> >> Here is the latest code. >> >> ====================================================== >> ====================================================== >> >> [text show=f]SPSubtotal=0[/text] >> [text show=f]SPQualify=f[/text] >> [text show=f]promoExists=f[/text] >> >> [lineitems] >> [showif [sku]~SP] >> [text show=f]SPSubtotal=[math >> show=t][SPSubtotal]+([price]*[quantity])[/math][/text] > > Here ^^^^^ you are treating the [SPSubtotal] both as a [math] and a > [text] var. There are ways that can work, and others that do not. > Without getting into it deeply now, may I just suggest that you change > all uses of [text] for this [SPSubtotal ] var into using [math] instead. > > see below for one possible complete version: > >> >> [/showif] >> [/lineitems] >> [showif [SPSubtotal]>99] >> [text show=f]SPQualify=t[/text] >> [/showif] >> >> [showif [SPQualify]=t] >> [lineitems] >> [showif [url][sku][/url]=SP133P-PROMO] >> [setlineitem >> file=^sc/[kart]&index=[lineindex]]quantity=1[/setlineitem] >> [text show=f]promoExists=t[/text] >> [/showif] >> [/lineitems] >> [showif [promoExists]=f] >> [addlineitem >> file=^sc/[kart]&sku=SP133P-PROMO&db=^db/products.db]quantity=1[/addlineitem] >> >> [/showif] >> [/showif] >> >> SPQualify=[SPQualify]
>> SPSubtotal=[SPSubtotal]
>> promoexists=[promoexists]
>> >> ====================================================== >> ====================================================== >> >> It works fairly well. All the variables are set properly every single >> time. However, I'm running into a issue when I try this test: >> >> 1. Add an item that has a SKU that begins with SP onto the shopping cart. >> 2. Proceed through checkout until SP133P-PROMO is added to shopping cart. >> 3. Remove the SP133P-PROMO from the shopping cart. >> 4. Add another item to the shopping cart. >> 4. Proceed through checkout. >> >> Even if there is over $100 worth of skus beginning with SP in the >> shopping cart, and even though the SPQualify var is set to t, it does >> not add the SP133P-PROMO to the shopping cart. >> >> -- >> Ki Song >> > > ====================================================== > ====================================================== > > [math show=f]SPSubtotal=0[/math] > [text show=f]SPQualify=f[/text] > [text show=f]promoExists=f[/text] > > [lineitems] > [showif [sku]~SP] > [math show=f]SPSubtotal=[SPSubtotal]+([price]*[quantity])[/math] > [/showif] > [/lineitems] > [showif [SPSubtotal]>99] > [text show=f]SPQualify=t[/text] > [/showif] > > [showif [SPQualify]=t] > [lineitems] > [showif [url][sku][/url]=SP133P-PROMO] > [setlineitem > file=^sc/[kart]&index=[lineindex]]quantity=1[/setlineitem] > [!] -- I don't see the value of this ^^^ line. What is > it doing that changes something? -- [/!] > [text show=f]promoExists=t[/text] > [/showif] > [/lineitems] > [showif [promoExists]=f] > [addlineitem > file=^sc/[kart]&sku=SP133P-PROMO&db=^db/products.db]quantity=1[/addlineitem] > > [/showif] > [/showif] > > SPQualify=[SPQualify]
> SPSubtotal=[SPSubtotal]
> promoexists=[promoexists]
> > ====================================================== > ====================================================== > > -G > >> Govinda wrote: >>> this has a bug where I marked, see below: >>> On Feb 5, 2009, at 12:18 PM, Ki Song wrote: >>>> I found some bugs ... here's the modified code: >>>> >>>> ====================================================== >>>> ====================================================== >>>> [text show=f]SPSubtotal=0[/text] >>>> [text show=f]SPQualify=f[/text] >>>> [text show=f]promoExists=f[/text] >>>> >>>> [lineitems] >>>> [showif [sku]~SP] >>>> [math show=f]SPSubtotal=[SPSubtotal]+([price]*[quantity])[/math] >>>> [/showif] >>>> [/lineitems] >>>> [showif [url]SPSubtotal>99] >>> Here, you are missing the ^^^^^ closing [/url] around [SPSubtotal]. >>> and also it (the var [SPSubtotal] itself) should be enclosed by >>> square brackets if you expect the value of that var to be inserted >>> there. >>>> >>>> [text show=f]SPQualify=t[/text] >>>> [/showif] >>>> >>>> [SPQualify],[SPSubtotal][!]I want to see what SPQualify and SPSubtotal >>>> are set to[/!] >>>> ====================================================== >>>> ====================================================== >>>> >>>> I have an item in the cart that starts with SP and is over 100. >>>> However, the variables show up as f and 0, respectively. >>>> >>>> Same result. >>>> >>>> >>>> Ki Song >>>> >>>> Ki Song wrote: >>>>> Can you guys take a look at the code below: >>>>> ====================================================== >>>>> ====================================================== >>>>> [text show=f]SPSubtotal=0[/text] >>>>> [text show=f]SPQualify=f[/text] >>>>> [text show=f]promoExists=f[/text] >>>>> [lineitems] >>>>> [showif [url][sku][/url]~SP] >>>>> [showif [math >>>>> show=f]SPSubtotal=[SPSubtotal]+([price]*[quantity])[/math]>99] >>>>> [text show=f]SPQualify=t[/text] >>>>> [/showif] >>>>> [/showif] >>>>> [/lineitems] >>>>> [SPQualify],[SPSubtotal][!]I want to see what SPQualify and >>>>> SPSubtotal are set to[/!] >>>>> ====================================================== >>>>> ====================================================== >>>>> I have an item in the cart that starts with SP and is over 100. >>>>> However, the variables show up as f and 0, respectively. >>>>> Can you guys see anything wrong? >>>>> --------------------------------------------------------- >>>>> This message is sent to you because you are subscribed to >>>>> the mailing list . >>>>> To unsubscribe, E-mail to: >>>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>>> old archives: http://dev.webdna.us/TalkListArchive/ >>>> --------------------------------------------------------- >>>> This message is sent to you because you are subscribed to >>>> the mailing list . >>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>> old archives: http://dev.webdna.us/TalkListArchive/ >>> --------------------------------------------------------- >>> This message is sent to you because you are subscribed to >>> the mailing list . >>> To unsubscribe, E-mail to: >>> archives: http://mail.webdna.us/list/talk@webdna.us >>> old archives: http://dev.webdna.us/TalkListArchive/ >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> old archives: http://dev.webdna.us/TalkListArchive/ > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > old archives: http://dev.webdna.us/TalkListArchive/ Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Shopping cart code debug (Marc Thompson 2009)
  2. Re: [WebDNA] Shopping cart code debug (Ki Song 2009)
  3. Re: [WebDNA] Shopping cart code debug (Govinda 2009)
  4. Re: [WebDNA] Shopping cart code debug (Donovan Brooke 2009)
  5. Re: [WebDNA] Shopping cart code debug (Ki Song 2009)
  6. Re: [WebDNA] Shopping cart code debug (Govinda 2009)
  7. Re: [WebDNA] Shopping cart code debug (Govinda 2009)
  8. Re: [WebDNA] Shopping cart code debug ("Dan Strong" 2009)
  9. Re: [WebDNA] Shopping cart code debug (Donovan Brooke 2009)
  10. Re: [WebDNA] Shopping cart code debug (Ki Song 2009)
  11. [WebDNA] Shopping cart code debug (Ki Song 2009)
Changed the code to the one below, but still the same issue. > ====================================================== > ====================================================== > > [math show=f]SPSubtotal=0[/math] > [text show=f]SPQualify=f[/text] > [text show=f]promoExists=f[/text] > > [lineitems] > [showif [sku]~SP] > [math show=f]SPSubtotal=[SPSubtotal]+([price]*[quantity])[/math] > [/showif] > [/lineitems] > [showif [SPSubtotal]>99] > [text show=f]SPQualify=t[/text] > [/showif] > > [showif [SPQualify]=t] > [lineitems] > [showif [url][sku][/url]=SP133P-PROMO] > [setlineitem > file=^sc/[kart]&index=[lineindex]]quantity=1[/setlineitem] > [!] -- I don't see the value of this ^^^ line. What is If a customer adds more than 1 quantity of the SP133-PROMO, it sets it back to quantity 1. Essentially, we don't want someone to get more than 1 of the promo item. Does that make sense? > it doing that changes something? -- [/!] > [text show=f]promoExists=t[/text] > [/showif] > [/lineitems] > [showif [promoExists]=f] > [addlineitem > file=^sc/[kart]&sku=SP133P-PROMO&db=^db/products.db]quantity=1[/addlineitem] > > [/showif] > [/showif] > > SPQualify=[SPQualify]
> SPSubtotal=[SPSubtotal]
> promoexists=[promoexists]
> > ====================================================== > ====================================================== Ki Song Govinda wrote: > I have to get to my own work just now.. but one thing more jumped out > at me here/now: > see below: > > On Feb 5, 2009, at 1:30 PM, Ki Song wrote: > >> OK. >> >> Here is the latest code. >> >> ====================================================== >> ====================================================== >> >> [text show=f]SPSubtotal=0[/text] >> [text show=f]SPQualify=f[/text] >> [text show=f]promoExists=f[/text] >> >> [lineitems] >> [showif [sku]~SP] >> [text show=f]SPSubtotal=[math >> show=t][SPSubtotal]+([price]*[quantity])[/math][/text] > > Here ^^^^^ you are treating the [SPSubtotal] both as a [math] and a > [text] var. There are ways that can work, and others that do not. > Without getting into it deeply now, may I just suggest that you change > all uses of [text] for this [SPSubtotal ] var into using [math] instead. > > see below for one possible complete version: > >> >> [/showif] >> [/lineitems] >> [showif [SPSubtotal]>99] >> [text show=f]SPQualify=t[/text] >> [/showif] >> >> [showif [SPQualify]=t] >> [lineitems] >> [showif [url][sku][/url]=SP133P-PROMO] >> [setlineitem >> file=^sc/[kart]&index=[lineindex]]quantity=1[/setlineitem] >> [text show=f]promoExists=t[/text] >> [/showif] >> [/lineitems] >> [showif [promoExists]=f] >> [addlineitem >> file=^sc/[kart]&sku=SP133P-PROMO&db=^db/products.db]quantity=1[/addlineitem] >> >> [/showif] >> [/showif] >> >> SPQualify=[SPQualify]
>> SPSubtotal=[SPSubtotal]
>> promoexists=[promoexists]
>> >> ====================================================== >> ====================================================== >> >> It works fairly well. All the variables are set properly every single >> time. However, I'm running into a issue when I try this test: >> >> 1. Add an item that has a SKU that begins with SP onto the shopping cart. >> 2. Proceed through checkout until SP133P-PROMO is added to shopping cart. >> 3. Remove the SP133P-PROMO from the shopping cart. >> 4. Add another item to the shopping cart. >> 4. Proceed through checkout. >> >> Even if there is over $100 worth of skus beginning with SP in the >> shopping cart, and even though the SPQualify var is set to t, it does >> not add the SP133P-PROMO to the shopping cart. >> >> -- >> Ki Song >> > > ====================================================== > ====================================================== > > [math show=f]SPSubtotal=0[/math] > [text show=f]SPQualify=f[/text] > [text show=f]promoExists=f[/text] > > [lineitems] > [showif [sku]~SP] > [math show=f]SPSubtotal=[SPSubtotal]+([price]*[quantity])[/math] > [/showif] > [/lineitems] > [showif [SPSubtotal]>99] > [text show=f]SPQualify=t[/text] > [/showif] > > [showif [SPQualify]=t] > [lineitems] > [showif [url][sku][/url]=SP133P-PROMO] > [setlineitem > file=^sc/[kart]&index=[lineindex]]quantity=1[/setlineitem] > [!] -- I don't see the value of this ^^^ line. What is > it doing that changes something? -- [/!] > [text show=f]promoExists=t[/text] > [/showif] > [/lineitems] > [showif [promoExists]=f] > [addlineitem > file=^sc/[kart]&sku=SP133P-PROMO&db=^db/products.db]quantity=1[/addlineitem] > > [/showif] > [/showif] > > SPQualify=[SPQualify]
> SPSubtotal=[SPSubtotal]
> promoexists=[promoexists]
> > ====================================================== > ====================================================== > > -G > >> Govinda wrote: >>> this has a bug where I marked, see below: >>> On Feb 5, 2009, at 12:18 PM, Ki Song wrote: >>>> I found some bugs ... here's the modified code: >>>> >>>> ====================================================== >>>> ====================================================== >>>> [text show=f]SPSubtotal=0[/text] >>>> [text show=f]SPQualify=f[/text] >>>> [text show=f]promoExists=f[/text] >>>> >>>> [lineitems] >>>> [showif [sku]~SP] >>>> [math show=f]SPSubtotal=[SPSubtotal]+([price]*[quantity])[/math] >>>> [/showif] >>>> [/lineitems] >>>> [showif [url]SPSubtotal>99] >>> Here, you are missing the ^^^^^ closing [/url] around [SPSubtotal]. >>> and also it (the var [SPSubtotal] itself) should be enclosed by >>> square brackets if you expect the value of that var to be inserted >>> there. >>>> >>>> [text show=f]SPQualify=t[/text] >>>> [/showif] >>>> >>>> [SPQualify],[SPSubtotal][!]I want to see what SPQualify and SPSubtotal >>>> are set to[/!] >>>> ====================================================== >>>> ====================================================== >>>> >>>> I have an item in the cart that starts with SP and is over 100. >>>> However, the variables show up as f and 0, respectively. >>>> >>>> Same result. >>>> >>>> >>>> Ki Song >>>> >>>> Ki Song wrote: >>>>> Can you guys take a look at the code below: >>>>> ====================================================== >>>>> ====================================================== >>>>> [text show=f]SPSubtotal=0[/text] >>>>> [text show=f]SPQualify=f[/text] >>>>> [text show=f]promoExists=f[/text] >>>>> [lineitems] >>>>> [showif [url][sku][/url]~SP] >>>>> [showif [math >>>>> show=f]SPSubtotal=[SPSubtotal]+([price]*[quantity])[/math]>99] >>>>> [text show=f]SPQualify=t[/text] >>>>> [/showif] >>>>> [/showif] >>>>> [/lineitems] >>>>> [SPQualify],[SPSubtotal][!]I want to see what SPQualify and >>>>> SPSubtotal are set to[/!] >>>>> ====================================================== >>>>> ====================================================== >>>>> I have an item in the cart that starts with SP and is over 100. >>>>> However, the variables show up as f and 0, respectively. >>>>> Can you guys see anything wrong? >>>>> --------------------------------------------------------- >>>>> This message is sent to you because you are subscribed to >>>>> the mailing list . >>>>> To unsubscribe, E-mail to: >>>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>>> old archives: http://dev.webdna.us/TalkListArchive/ >>>> --------------------------------------------------------- >>>> This message is sent to you because you are subscribed to >>>> the mailing list . >>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>> old archives: http://dev.webdna.us/TalkListArchive/ >>> --------------------------------------------------------- >>> This message is sent to you because you are subscribed to >>> the mailing list . >>> To unsubscribe, E-mail to: >>> archives: http://mail.webdna.us/list/talk@webdna.us >>> old archives: http://dev.webdna.us/TalkListArchive/ >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> old archives: http://dev.webdna.us/TalkListArchive/ > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > old archives: http://dev.webdna.us/TalkListArchive/ Ki Song

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:

WebDNAMonitor (2002) Re:listfiles-looking for slick solution (1997) Mac: [ListFiles] bug alert (1997) WebDNA Codes in Secure Mode (1997) Command=Showcart? (2000) WebCatalog2 Feature Feedback (1996) E-mail loop ! (1997) OT: really big site on xserve (2003) Date Sorting (1997) Cart passing in URL.. (2004) [WriteFile] problems (1997) File Format Validation (2005) Obscure Question of the day (1997) WebMerchant 1.6 and SHTML (1997) Date comparison (I think) has bugs ... (1998) Personal Web Server (1998) WebCat2 - many [carts] on one template page? (1997) Extended [ConvertChars] (1997) [append] vs. [appendfile] delta + question? (1997) [WriteFile] problems (1997)