Re: Addlineitems ... grrr
This WebDNA talk-list message is from 2004
It keeps the original formatting.
numero = 59694
interpreted = N
texte = WebDna @ Inkblot Media wrote:> Ok, I need assistance.> > I am checking a database to see if I should remove a dollar amount or a > percentage from an items price. I set a "newdiscount" variable to use in > the addlineitem.> > 1. The math is working. If I display [newdiscount] the value is fine.> > 2. If I break the AddLineItem and display it on screen the only > difference is that the DOLLAR one if 5 and the PERCENTAGE one is 3.> > 3. The DOLLAR style works perfectly. The PERCENTAGE does not.> > WHY? Code follows!> > [showif [style]=percentage]> [text]newdiscount=[math][amount]*.[showif > [countchars][discount][/countchars]=1]0[/showif][discount][/math][/text]> [/showif]Do the variables always have values? Math doesn't like nulled variables. Put a0 before the value to be sure.Donovan> > [showif [style]=dollar]> [text]newdiscount=[discount][/text]> [/showif]> > [AddLineItem > cart=[cart]&sku=[coupon_code]&db=admin/coupons.db]SKU=[coupon_code]&price=-[newdiscount]&password=[lookup > db=WebCatalog > Prefs&lookinfield=preference&value=LineItemChangePassword&returnfield=value][/AddLineItem] -- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Eucalyptus Design <-Web Development (specializing in eCommerce), -> <- Graphic Design, Custom Tags and Labels -> ADDRESS:> Donovan Brooke DBA Eucalyptus Design N2862 Summerville Park Rd. Lodi, WI 53555 PH:> 1.608.592.3567 Web:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o-------------------------------------------------------------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:
WebDna @ Inkblot Media wrote:> Ok, I need assistance.> > I am checking a database to see if I should remove a dollar amount or a > percentage from an items price. I set a "newdiscount" variable to use in > the addlineitem.> > 1. The math is working. If I display [newdiscount] the value is fine.> > 2. If I break the AddLineItem and display it on screen the only > difference is that the DOLLAR one if 5 and the PERCENTAGE one is 3.> > 3. The DOLLAR style works perfectly. The PERCENTAGE does not.> > WHY? Code follows!> > [showif [style]=percentage]> [text]newdiscount=[math][amount]*.[showif > [countchars][discount][/countchars]=1]0[/showif][discount][/math][/text]> [/showif]Do the variables always have values? Math doesn't like nulled variables. Put a0 before the value to be sure.Donovan> > [showif [style]=dollar]> [text]newdiscount=[discount][/text]> [/showif]> > [AddLineItem > cart=[cart]&sku=[coupon_code]&db=admin/coupons.db]SKU=[coupon_code]&price=-[newdiscount]&password=[lookup > db=WebCatalog > Prefs&lookinfield=preference&value=LineItemChangePassword&returnfield=value][/AddLineItem] -- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Eucalyptus Design <-Web Development (specializing in eCommerce), -> <- Graphic Design, Custom Tags and Labels -> ADDRESS:> Donovan Brooke DBA Eucalyptus Design N2862 Summerville Park Rd. Lodi, WI 53555 PH:> 1.608.592.3567 Web:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o-------------------------------------------------------------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/
Donovan Brooke
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:
protect (summer holidays with wcat???) (2000)
I'm new be kind (1997)
[switch] platform specific bug??? (2003)
Multiple Merchant Accounts? (1997)
PIXO support (1997)
RE: Problems with dbcatalog.exe (1997)
Chown www:wheel Almost There WebCat 5 on itools 7 (2003)
Showif date range comparison (1999)
I am dumb. No see [variable] (2003)
4.5 license (mac classic) for sale? (2004)
Search/sort in URL Was: GuestBook example (1997)
[append] vs. [appendfile] delta + question? (1997)
newbie question about zip code search (2003)
Country & Ship-to address & other fields ? (1997)
Transfering [text] variables (2000)
Web Catalog vs. ICAT (1997)
Re:Password Authentication - request example (1998)
MAC versions of WebCatalog 2.1 and WebMerchant 2.1 (1998)
Include Files (1998)
[WebDNA] Recursive File Listing (Listfile) (2019)