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:

Memory Error message (1998) WebCat2b13MacPlugin - nested [xxx] contexts (1997) Browser Problem?!? Still getting Error message using POST! (1997) can webcat determine an image's pixel dimensions? (2000) How true is this? (1999) WC on Linux question (2001) Database Advice (1996) AddLineItem Problem (1997) PCS Frames (1997) Stats (2004) Not reading code (1997) WCS Newbie question (1997) A Global Variable (1997) Date or time comparisons have bugs ... (1998) Founditems Add/remove graphic display problem (1999) Changing buttons (1999) WebDNA Solutions ... sorry! (1997) Problems passing [SKU] with $Replace in 2.0 (1997) dates and hex formatting (1997) Database Posting (2000)