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]
======================================================MarcDonovan 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 ThompsonSoftware EngineerOffice of Information TechnologyUniversity of Utah801.585.9264marc.thompson@utah.edu-------------------------------------------
Associated Messages, from the most recent to the oldest:
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]
======================================================MarcDonovan 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 ThompsonSoftware EngineerOffice of Information TechnologyUniversity of Utah801.585.9264marc.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:
RAM variables (1997)
Other then credit cards-how? (1997)
Sorting (1998)
html delivery (1997)
updating with ProductEditor (1998)
Include binary files in template/XML (SOLVED/Request (2004)
Emailer 2.1.1 delivers to bcc twice? (1998)
no global [username] or [password] displayed ... (1997)
WebMerchant Question (2000)
Help! WebCat2 bug (1997)
WebCatalog Q & A pages (1997)
Navigator 4.01 (1997)
problem with dates, NT version (1997)
ANN: Strategic Partnership with BuyStream Announced. (2000)
More on the email templates (1997)
Support ?? (1997)
WebCatalog-NT?'s (1996)
Error Msg (1998)
RE: Unexceling (was I need a smart quote...) (1999)
return missing item (was:WebCat Sales) (1997)