Re: Find Duplicates in Cart

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 37401
interpreted = N
texte = >Clint Davis wrote: >> >> When visitors add an item to their cart, the quantity should be >> updated if the same item is already in their cart. I found some code >> in the archives to check for duplicates, but I'm having considerable >> trouble integrating it with the system below. >> > >There are two ways to do this (that I can think of off the top of my >head). The way we do it is we allow the user to change the quantity >on the cart page, so they only ADD the line ONCE and can alter the >number they want to order easily. I admit that we don't check to be >sure the user has not added the same item twice, but the way our site >is structured, it is unlikely. And they can always delete the dupe >line from the cart.With this store, visitors are only ALLOWED to order a certain quantity for each SKU. The maximum quantity is stored in the database and is used to generate a pulldown menu for the quantity (usually max=2). >The other way is to have a [lineitems] context at the top of the page, >before you add new new line item, and if the sku is the same, just >increment the quantity.This is what I'm trying to do, but I can't seem to get the code from the Tiny Store example integrated with the Duplicate Locator code from the archives. I need to loop through each checked item from the order.html page and compare each SKU to the lineitems list. If a match is found, the quantity needs to be updated rather than adding a duplicate.As you can see, I understand the process. I just can't get the code to work as it should. >Note that SKU should be completely unique; a GREEN shirt should have >a different SKU from a BLACK shirt, even if it is the same style >shirt. This is trivial to do, since you have complete control over >what is stored in the cart. If your main database has SKU=T-SHIRT, >then you can store T-SHIRT-GREEN as the cart SKU. There is nothing >to say that the cart SKU has to match the database SKU, except you >need to have your own PRICE formula.All of my SKU's are unique, so this shouldn't be an issue.> >HTH > >John > >-- >John Peacock-- _______________________Clint Davis Webmaster Gray Loon Marketing Group 812.422.9999cdavis@grayloon.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: Find Duplicates in Cart (John Peacock 2001)
  2. Re: Find Duplicates in Cart (Clint Davis 2001)
  3. Re: Find Duplicates in Cart (John Peacock 2001)
  4. Find Duplicates in Cart (Clint Davis 2001)
>Clint Davis wrote: >> >> When visitors add an item to their cart, the quantity should be >> updated if the same item is already in their cart. I found some code >> in the archives to check for duplicates, but I'm having considerable >> trouble integrating it with the system below. >> > >There are two ways to do this (that I can think of off the top of my >head). The way we do it is we allow the user to change the quantity >on the cart page, so they only ADD the line ONCE and can alter the >number they want to order easily. I admit that we don't check to be >sure the user has not added the same item twice, but the way our site >is structured, it is unlikely. And they can always delete the dupe >line from the cart.With this store, visitors are only ALLOWED to order a certain quantity for each SKU. The maximum quantity is stored in the database and is used to generate a pulldown menu for the quantity (usually max=2). >The other way is to have a [lineitems] context at the top of the page, >before you add new new line item, and if the sku is the same, just >increment the quantity.This is what I'm trying to do, but I can't seem to get the code from the Tiny Store example integrated with the Duplicate Locator code from the archives. I need to loop through each checked item from the order.html page and compare each SKU to the lineitems list. If a match is found, the quantity needs to be updated rather than adding a duplicate.As you can see, I understand the process. I just can't get the code to work as it should. >Note that SKU should be completely unique; a GREEN shirt should have >a different SKU from a BLACK shirt, even if it is the same style >shirt. This is trivial to do, since you have complete control over >what is stored in the cart. If your main database has SKU=T-SHIRT, >then you can store T-SHIRT-GREEN as the cart SKU. There is nothing >to say that the cart SKU has to match the database SKU, except you >need to have your own PRICE formula.All of my SKU's are unique, so this shouldn't be an issue.> >HTH > >John > >-- >John Peacock-- _______________________Clint Davis Webmaster Gray Loon Marketing Group 812.422.9999cdavis@grayloon.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/ Clint Davis

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:

Conditional searching & displaying (1997) Thanks Grant (1997) OT: Safari/Mac - frames and iframes acting weird (2007) To brighten your day... (2006) [cart] not being interpreted inside [founditems] (1997) Upgrading old WebCat Database Files (1997) Been to the SmithMicro site lately??? (2008) Intermitent problem using [referrer] (1997) Quit revisited (1997) (1997) RE: Languages (1997) Replace context problem ... (1997) SAVECART (1997) Help! WebCat2 bug (1997) New public beta available (1997) Can't access [OrderFile] OSXS WC4 (2000) Using [detete] (1998) Nested tags count question (1997) How far do [showif]s go? (1997) Verifying SSL on Page (2002)