Re: 2cd pare of eyes.

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 39396
interpreted = N
texte = Why are you using neSKUdatarq=[blank] in your search and not eqSKUdatarq=[name], or for that matter, a lookup? Also, do you only want to add the SKUs to the cart if they are ALL valid, or do you want to add only valid ones and ignore invalid ones?This code should do the latter...[showif [qo]=update] [!]to decide if the items listed are ready to add to the cart[/!] [!]###loop for every formvariable who's name contains 'SKU'...###[/!] [formvariables name=SKU&exact=F] [hideif [url][value][/url]=] [text]valid=no[/text] [!]###see if formvariable SKU is in products.db...###[/!] [text]theSKU=[lookup db=admin/products.db&value=[name]&lookinfield=SKU&returnfield=SKU¬found=][/text] [showif [theSKU]!] [text]valid=yes[/text] [/showif] [showif [theSKU]=] [text]theSKU=NL[/text] [!]<=== do you need this? ###[/!] [/showif] [showif [valid]=yes] [!]verifies if item is already in cart[/!] [orderfile cart=[cart]] [lineitems] [showif [url][theSKU][/url]=[SKU]] [text]incart=T[/text] [/showif] [hideif [incart]=T] [text]shop=put[/text] [/hideif] [/lineitems] [/orderfile] [!]this adds the item[/!] [showif [shop]=put] [addlineitem cart=[cart]&db=admin/products.db&sku=[url][theSKU][/url]][/addlineitem] [/showif] [/showif] [/hideif] [/formvariables] [/showif] Gene>thanks, you are probably right. see below: > >Samuel Renkert wrote: > >> [snip] > >> Donovan, I don't see any syntax errors, their might be some logic >> errors, what are you trying to do (with context)? > >Basically I'm trying to first update a few form input values that are all called SKUsomething >by verifying that the value is in our products.db. If all of them are valid then >a flag ([valid]=yes) allows the update to proceed to adding these skus to the cart. Funny thing is this >kind of worked a couple times when I had some misplaced showif's... then I changed some >things and now I can't figure it out. Though I don't have time to work on in the next couple >hours I sure would appreciate any ideas. One logical error I just noticed is that if I have more than >one SKU and the first one is not valid and the second is, it looks like it will give [valid] a value of yes >in the end which is not what I want. I have some text on this page that is triggered by a valid=no >to let the user know that one or more items is not listed. Also, NL replaces the value of the inappropriate >SKU's they typed in. :-) I won't go into a novel here just thought I'd explain a lil. This is for >an alternative (quick order) way of ordering. > >you can see it here. (damadged as it is.) >http://216.81.241.229/proforms/quickorder.html >10-M is a valid product. >D > > >[showif [qo]=update] >[!]to decide if the items listed are ready to add to the cart[/!] > [formvariables name=SKU&exact=F] > [hideif [url][value][/url]=] > [text]valid=no[/text] > [search db=admin/products.db&neSKUdatarq=[blank]] > [founditems] > [showif [url][value][/url]=[SKU]] > [text]valid=yes[/text] > [text]theSKU=[SKU][/text] > [/showif] > [/founditems] > [showif [numfound]=0] > [text][name]=NL[/text] > [/showif] > [/search] > [showif [valid]=yes] >[!]verifies if item is already in cart[/!] > [orderfile cart=[cart]] > [lineitems] > [showif [url][theSKU][/url]=[SKU]] > [text]incart=T[/text] > [/showif] > [hideif [incart]=T] > [text]shop=put[/text] > [/hideif] > [/lineitems] > [/orderfile] >[!]this adds the item[/!] > [showif [shop]=put] > [addlineitem cart=[cart]&db=admin/products.db&sku=[url][theSKU][/url]][/addlineitem] > [/showif] > [/showif] > [/hideif] > [/formvariables] >[/showif] > >-- Donovan D. Brooke >Systems Administrator/ >Assc. Art Director >Epsen Hillmer Graphics > > >I know I'm making progress when I look at the questions I have >asked in the past and think to myself... how stupid was that > > >------------------------------------------------------------- >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://search.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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: 2cd pare of eyes. (Donovan Brooke 2001)
  2. Re: 2cd pare of eyes. (Donovan Brooke 2001)
  3. Re: 2cd pare of eyes. (Gene Beljaeff 2001)
  4. Re: 2cd pare of eyes. (Donovan Brooke 2001)
  5. Re: 2cd pare of eyes. (Samuel Renkert 2001)
  6. Re: 2cd pare of eyes. (Jeroen de Wijn 2001)
  7. 2cd pare of eyes. (Donovan Brooke 2001)
Why are you using neSKUdatarq=[blank] in your search and not eqSKUdatarq=[name], or for that matter, a lookup? Also, do you only want to add the SKUs to the cart if they are ALL valid, or do you want to add only valid ones and ignore invalid ones?This code should do the latter...[showif [qo]=update] [!]to decide if the items listed are ready to add to the cart[/!] [!]###loop for every formvariable who's name contains 'SKU'...###[/!] [formvariables name=SKU&exact=F] [hideif [url][value][/url]=] [text]valid=no[/text] [!]###see if formvariable SKU is in products.db...###[/!] [text]theSKU=[lookup db=admin/products.db&value=[name]&lookinfield=SKU&returnfield=SKU¬found=][/text] [showif [theSKU]!] [text]valid=yes[/text] [/showif] [showif [theSKU]=] [text]theSKU=NL[/text] [!]<=== do you need this? ###[/!] [/showif] [showif [valid]=yes] [!]verifies if item is already in cart[/!] [orderfile cart=[cart]] [lineitems] [showif [url][theSKU][/url]=[SKU]] [text]incart=T[/text] [/showif] [hideif [incart]=T] [text]shop=put[/text] [/hideif] [/lineitems] [/orderfile] [!]this adds the item[/!] [showif [shop]=put] [addlineitem cart=[cart]&db=admin/products.db&sku=[url][theSKU][/url]][/addlineitem] [/showif] [/showif] [/hideif] [/formvariables] [/showif] Gene>thanks, you are probably right. see below: > >Samuel Renkert wrote: > >> [snip] > >> Donovan, I don't see any syntax errors, their might be some logic >> errors, what are you trying to do (with context)? > >Basically I'm trying to first update a few form input values that are all called SKUsomething >by verifying that the value is in our products.db. If all of them are valid then >a flag ([valid]=yes) allows the update to proceed to adding these skus to the cart. Funny thing is this >kind of worked a couple times when I had some misplaced showif's... then I changed some >things and now I can't figure it out. Though I don't have time to work on in the next couple >hours I sure would appreciate any ideas. One logical error I just noticed is that if I have more than >one SKU and the first one is not valid and the second is, it looks like it will give [valid] a value of yes >in the end which is not what I want. I have some text on this page that is triggered by a valid=no >to let the user know that one or more items is not listed. Also, NL replaces the value of the inappropriate >SKU's they typed in. :-) I won't go into a novel here just thought I'd explain a lil. This is for >an alternative (quick order) way of ordering. > >you can see it here. (damadged as it is.) >http://216.81.241.229/proforms/quickorder.html >10-M is a valid product. >D > > >[showif [qo]=update] >[!]to decide if the items listed are ready to add to the cart[/!] > [formvariables name=SKU&exact=F] > [hideif [url][value][/url]=] > [text]valid=no[/text] > [search db=admin/products.db&neSKUdatarq=[blank]] > [founditems] > [showif [url][value][/url]=[SKU]] > [text]valid=yes[/text] > [text]theSKU=[SKU][/text] > [/showif] > [/founditems] > [showif [numfound]=0] > [text][name]=NL[/text] > [/showif] > [/search] > [showif [valid]=yes] >[!]verifies if item is already in cart[/!] > [orderfile cart=[cart]] > [lineitems] > [showif [url][theSKU][/url]=[SKU]] > [text]incart=T[/text] > [/showif] > [hideif [incart]=T] > [text]shop=put[/text] > [/hideif] > [/lineitems] > [/orderfile] >[!]this adds the item[/!] > [showif [shop]=put] > [addlineitem cart=[cart]&db=admin/products.db&sku=[url][theSKU][/url]][/addlineitem] > [/showif] > [/showif] > [/hideif] > [/formvariables] >[/showif] > >-- Donovan D. Brooke >Systems Administrator/ >Assc. Art Director >Epsen Hillmer Graphics > > >I know I'm making progress when I look at the questions I have >asked in the past and think to myself... how stupid was that > > >------------------------------------------------------------- >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://search.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://search.smithmicro.com/ Gene Beljaeff

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:

[WebDNA] WebDNA Crashing or Not **YES** (2008) Log-in Scheme (2003) Newbie questions (1999) [WebDNA] Crontab to execute DNA (2012) serial number generation (1997) http upload (2001) WebCatalog NT beta 18 problem (1997) show me your store ! (2003) [WebDNA] Need to convert unix date? (2009) frames & carts (1997) Navigator 4.01 (1997) LOOP and IF statements (1997) shocart strange behavior (1999) wc 2 pro users - sites, quotes wanted (1997) showif field is number (1997) Using [Showif] tag. Mac (1997) cc auth with [purchase] (1998) WebCat2: multiple currency support (1997) WebCatalog 2.1b4/Mac available (1997) Re:2nd WebCatalog2 Feature Request (1996)