Re: Addlineitems ... grrr

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 59695
interpreted = N
texte = The values are ALWAYS populated. See #1. :) It is breaking because it cannot find the value in the DB or something along those lines, because it is not working with any of the new SKUs in the coupons.db. The search that is on the page works fine finding the coupoun SKU and assigning values. It is just that the AddLineItems will not work with any of the new SKUs. It work fine if I hardcode the SKU in the AddLineItems to the first SKU in the DB, but then when I assign the SKU= value it is always the one that I HardCoded the value to. ie. [AddLineItem cart=[cart]&sku=rem-123&db=admin/coupons.db]SKU=[coupon_code] will set SKU to REM-123 even if the variable Coupon_Code is REM-GET_OFF_IT. But if I try: [AddLineItem cart=[cart]&sku=[coupon_code]&db=admin/coupons.db]SKU=[coupon_code] and Coupon_code is a valued sku in the coupons.db it does not work UNLESS it is the REM-123 value. ----- Original Message ----- From: "Donovan Brooke" To: "WebDNA Talk" Sent: Wednesday, October 20, 2004 3:56 PM Subject: Re: Addlineitems ... grrr > 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 a > 0 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/ ------------------------------------------------------------- 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: Addlineitems ... grrr ( "WebDna @ Inkblot Media" 2004)
  2. Re: Addlineitems ... grrr ( Donovan Brooke 2004)
  3. Re: Addlineitems ... grrr ( "WebDna @ Inkblot Media" 2004)
  4. Re: Addlineitems ... grrr ( Donovan Brooke 2004)
  5. Re: Addlineitems ... grrr ( "WebDna @ Inkblot Media" 2004)
  6. Addlineitems ... grrr ( "WebDna @ Inkblot Media" 2004)
The values are ALWAYS populated. See #1. :) It is breaking because it cannot find the value in the DB or something along those lines, because it is not working with any of the new SKUs in the coupons.db. The search that is on the page works fine finding the coupoun SKU and assigning values. It is just that the AddLineItems will not work with any of the new SKUs. It work fine if I hardcode the SKU in the AddLineItems to the first SKU in the DB, but then when I assign the SKU= value it is always the one that I HardCoded the value to. ie. [AddLineItem cart=[cart]&sku=rem-123&db=admin/coupons.db]SKU=[coupon_code] will set SKU to REM-123 even if the variable Coupon_Code is REM-GET_OFF_IT. But if I try: [AddLineItem cart=[cart]&sku=[coupon_code]&db=admin/coupons.db]SKU=[coupon_code] and Coupon_code is a valued sku in the coupons.db it does not work UNLESS it is the REM-123 value. ----- Original Message ----- From: "Donovan Brooke" To: "WebDNA Talk" Sent: Wednesday, October 20, 2004 3:56 PM Subject: Re: Addlineitems ... grrr > 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 a > 0 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/ ------------------------------------------------------------- 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/ "WebDna @ Inkblot Media"

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:

Erotic Sites (1997) show me your store ! (2003) PDF Difficulties (2000) Looping (2000) Copyright ? (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) emailer w/F2 (1997) [WebDNA] interesting bug webdna 6 (2012) PSC recommends what date format yr 2000??? (1997) URGENT: WebCatalog 2.0 (1998) Hotmail and HTML emails (2003) newbie question about zip code search (2003) WCS Newbie question (1997) WC1.6 to WC2 date formatting (1997) Download Question (1997) Re:Need help... (1997) Re:2.1 pricing? (1998) Implementing Gift Certificates in online store (1998) Using WebMerchant Only? (1998) WebCatalog for guestbook ? (1997)