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:

secret [cmd] variable? (2004) creating a ShipCosts database (1997) Harvesting invalid email addresses from bounced emails??? (2000) No Access warning when caching HTML files (1997) Signal Raised error (1997) linetiems in thankyou.tpl (1997) Re:no template caching (1997) Not reading blanks (1998) [OT] Connect to MySQL (2004) [protect] error page (1997) WebCat2b15MacPlugin - showing [math] (1997) quotes and truncating? (1997) SiteEdit (1999) Ampersand Character (&) (1997) Problems with [Applescript] (1997) grep question - how to strip spaces from the beginning ofa string? (2002) syntax question, not in online refernce (1997) WebCat b13 CGI -shownext- (1997) synching databases on multiple servers (1997) Very serious bug with the [protect] tag (2003)