Re: Thanks and new Question on lineitems

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 43644
interpreted = N
texte = Before you use your [addlineitem] context, you will need to loop through the lineitems and determine if that item is already in the cart. An easy method to this is to use a text variable and a show if....Say you are passing the variable ?item=123 into your page that does the [addlineitem]...[orderfile cart=[cart]] [lineitems] [showif [sku]=[item]] [text]itemInCart=T[/text] [/lineitems] [/orderfile][hideif [itemInCart]=T] [addlineitem db=yourdatabase.db&sku=[item]&cart=[cart]]...(your other parameters)...[/addlineitem] [/hideif]Paul Berman wrote:> Thanks Robert, sorry for not giving the correct info in the first place. > > One more thing > > Is it possible to remove duplicates so only one of each item can be added to > the cart and if the user adds another its either ignored or removed. > > I havent given the option of quantity deliberately but you can still add the > same item twice and I need to stop this > > Many thanks > Paul > ----- Original Message ----- > From: Robert Wade > To: WebCatalog Talk > Sent: Friday, September 20, 2002 6:57 PM > Subject: Re: Showing formatted results in tables > > > Your original post said The results of a search. I wasn't aware you > were listing > > lineitems. You would need to use [lineindex] rather than [index]. > [index] is not > > a parameter of [lineitems]. > > > > Paul Berman wrote: > > > > > Hi > > > > > > [showif [index]\2][/showif] isnt working > > > > > > I am listing the[orderfile] [lineitems] > > > and I need them in pairs thsi doesnt seem to work inside these tags > > > > > > Just keep getting new rows > > > > > > Which tag or variable can I use inside this > > > > > > Thanks > > > paul > > > > > > ----- Original Message ----- > > > From: Robert Wade > > > To: WebCatalog Talk > > > Sent: Friday, September 20, 2002 6:34 PM > > > Subject: Re: Showing formatted results in tables > > > > > > > > > > > > > > > [founditems] > > > > > > > > > > > > > > > > [showif [index]\2][/showif] > > > > > > > > [/founditems] > > > > > > > >
[your stuff here]
> > > > > > > > Try this. This will simply add a closing row tag and start a new one > of > > > the index > > > > of the founditem in the loop is divisible by 2. I think it's correct, > I > > > wrote it > > > > out pretty quick. > > > > > > > > -Robert > > > > > > > > Paul Berman wrote: > > > > > > > > > Hi > > > > > > > > > > I need to show the results of a search in a table that is two rows > wide > > > with > > > > > one result per cell and then produce the next table row. > > > > > > > > > > I either get them all in one row or one column > > > > > > > > > > I know its someting simple but its friday > > > > > > > > > > Thanks > > > > > > > > > > ------------------------------------------------------------- > > > > > 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/ > > > > > > > > > > ------------------------------------------------------------- > > > 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/ > > > > ------------------------------------------------------------- > 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: Thanks and new Question on lineitems (NovaDerm Skincare Science 2002)
  2. Re: Thanks and new Question on lineitems (Paul Berman 2002)
  3. Re: Thanks and new Question on lineitems (NovaDerm Skincare Science 2002)
  4. Re: Thanks and new Question on lineitems (Paul 2002)
  5. Re: Thanks and new Question on lineitems (Daryl Mitchell 2002)
  6. Re: Thanks and new Question on lineitems (Robert Wade 2002)
  7. Re: Thanks and new Question on lineitems (Paul Berman 2002)
Before you use your [addlineitem] context, you will need to loop through the lineitems and determine if that item is already in the cart. An easy method to this is to use a text variable and a show if....Say you are passing the variable ?item=123 into your page that does the [addlineitem]...[orderfile cart=[cart]] [lineitems] [showif [sku]=[item]] [text]itemInCart=T[/text] [/lineitems] [/orderfile][hideif [itemInCart]=T] [addlineitem db=yourdatabase.db&sku=[item]&cart=[cart]]...(your other parameters)...[/addlineitem] [/hideif]Paul Berman wrote:> Thanks Robert, sorry for not giving the correct info in the first place. > > One more thing > > Is it possible to remove duplicates so only one of each item can be added to > the cart and if the user adds another its either ignored or removed. > > I havent given the option of quantity deliberately but you can still add the > same item twice and I need to stop this > > Many thanks > Paul > ----- Original Message ----- > From: Robert Wade > To: WebCatalog Talk > Sent: Friday, September 20, 2002 6:57 PM > Subject: Re: Showing formatted results in tables > > > Your original post said The results of a search. I wasn't aware you > were listing > > lineitems. You would need to use [lineindex] rather than [index]. > [index] is not > > a parameter of [lineitems]. > > > > Paul Berman wrote: > > > > > Hi > > > > > > [showif [index]\2][/showif] isnt working > > > > > > I am listing the[orderfile] [lineitems] > > > and I need them in pairs thsi doesnt seem to work inside these tags > > > > > > Just keep getting new rows > > > > > > Which tag or variable can I use inside this > > > > > > Thanks > > > paul > > > > > > ----- Original Message ----- > > > From: Robert Wade > > > To: WebCatalog Talk > > > Sent: Friday, September 20, 2002 6:34 PM > > > Subject: Re: Showing formatted results in tables > > > > > > > > > > > > > > > [founditems] > > > > > > > > > > > > > > > > [showif [index]\2][/showif] > > > > > > > > [/founditems] > > > > > > > >
[your stuff here]
> > > > > > > > Try this. This will simply add a closing row tag and start a new one > of > > > the index > > > > of the founditem in the loop is divisible by 2. I think it's correct, > I > > > wrote it > > > > out pretty quick. > > > > > > > > -Robert > > > > > > > > Paul Berman wrote: > > > > > > > > > Hi > > > > > > > > > > I need to show the results of a search in a table that is two rows > wide > > > with > > > > > one result per cell and then produce the next table row. > > > > > > > > > > I either get them all in one row or one column > > > > > > > > > > I know its someting simple but its friday > > > > > > > > > > Thanks > > > > > > > > > > ------------------------------------------------------------- > > > > > 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/ > > > > > > > > > > ------------------------------------------------------------- > > > 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/ > > > > ------------------------------------------------------------- > 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/ Robert Wade

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:

[subtotal] and others (1997) WebCat2b15MacPlugin - showing [math] (1997) Problems setting MIME Headers (1998) WebCat2: Items xx to xx shown, etc. (1997) Looking up two prices in database? (1997) Running _every_ page through WebCat-error.html (1997) Showif, Hideif reverse logic ? (1997) encryption in browser? NOT (1998) Verisigns SDK (pay flo pro) (2002) Using [showif] within [lineitems] [code fragment] (2000) can I get formvariables for an include? (1999) Calculating Shipping (1997) Preferences Don't Stick Though ReBoot?? (2000) A better way to do this?? (2005) RE: [WebDNA] COMMITDATABASE in linux unix 64bits FastCGI version 8.6 (2020) Re:quit command on NT (1997) Plugin or CGI or both (1997) problem with [Format Days_To_Date] (2000) NY taxRates.db? (1997) numfound=0 for a search after going into the SSL (2003)