Re: [WebDNA] Shopping cart code debug

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 101945
interpreted = N
texte = A problem I see is changing variable SPSubtotal between [text] and [math] types and doing a math type comparison on a text type variable. And also, is your [cart] spelled with a k? If it was my code, id do it like this: ====================================================== [math show=f]SPSubtotal=1-1[/math] [text]SPQualify=f[/text] [text]promoExists=f[/text] [lineitems] [showif [sku]~SP] [math show=f]SPSubtotal=[SPSubtotal]+([price]*[quantity])[/math] [/showif] [/lineitems] [showif [SPSubtotal]>99] [text]SPQualify=t[/text] [/showif] [showif [SPQualify]=t] [lineitems] [showif [sku]=SP133P-PROMO] [setlineitem file=^sc/[kart]&index=[lineindex]]quantity=1[/setlineitem] [text]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]
====================================================== Marc Donovan Brooke wrote: > Govinda wrote: >> Ki Song, >> >> my first guess is that the problem you are having is because that >> [math show=f]... SHOULD BE [math show=t]... >> ..otherwise you are setting the value of the [SPSubtotal] var but you >> are not letting it become part of that [showif]'s comparison. >> >> -G > > good eyes! > > Donovan > > -- ------------------------------------------- Marc Thompson Software Engineer Office of Information Technology University of Utah 801.585.9264 marc.thompson@utah.edu ------------------------------------------- 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)
A problem I see is changing variable SPSubtotal between [text] and [math] types and doing a math type comparison on a text type variable. And also, is your [cart] spelled with a k? If it was my code, id do it like this: ====================================================== [math show=f]SPSubtotal=1-1[/math] [text]SPQualify=f[/text] [text]promoExists=f[/text] [lineitems] [showif [sku]~SP] [math show=f]SPSubtotal=[SPSubtotal]+([price]*[quantity])[/math] [/showif] [/lineitems] [showif [SPSubtotal]>99] [text]SPQualify=t[/text] [/showif] [showif [SPQualify]=t] [lineitems] [showif [sku]=SP133P-PROMO] [setlineitem file=^sc/[kart]&index=[lineindex]]quantity=1[/setlineitem] [text]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]
====================================================== Marc Donovan Brooke wrote: > Govinda wrote: >> Ki Song, >> >> my first guess is that the problem you are having is because that >> [math show=f]... SHOULD BE [math show=t]... >> ..otherwise you are setting the value of the [SPSubtotal] var but you >> are not letting it become part of that [showif]'s comparison. >> >> -G > > good eyes! > > Donovan > > -- ------------------------------------------- Marc Thompson Software Engineer Office of Information Technology University of Utah 801.585.9264 marc.thompson@utah.edu ------------------------------------------- Marc Thompson

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:

[BULK] [WebDNA] API Code - IP to Country code and zip Code to us census (2000) (2011) [OT] Xserve (2002) [WebDNA] Needing Open Source Support (2012) I need Typhoon Pro Tonight! (1999) Extra equals signs with IE? (More debugging questions...) (1997) sendmail and accented characters (1998) Post arguments problem mac? (1997) multi-paragraph fields (1997) Price Change (2000) WebCatalog on Solaris? (2000) unable to launch acgi in WebCat (1997) Mac Vs WindowsNT (1997) Using Plug-In while running 1.6.1 (1997) Kaaaaahhhhhhhnnnnnnn! (1997) WebCat2 beta 11 - new prefs ... (1997) Webcatalog 4.0 on Mac OS & WebStar (2000) WebTrends (2002) First postarg not taking in $Commands (1997) can WC render sites out? (1997) Re[3]: ftp access on Macos X (2000)