Re: Find Duplicates in Cart

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 37400
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.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.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.HTHJohn -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747------------------------------------------------------------- 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.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.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.HTHJohn -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747------------------------------------------------------------- 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/ John Peacock

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:

Review comparison by PC Magazine: Open for On-line Business (1997) WebTEN vs webSTARtopic (1998) OT:looking for developers with solutions (2000) Monthly Help File (2000) WebCatalog-NT?'s (1996) Counting LineItems (2000) Showing specific [cart] contents (1998) writefile, csv, tab and excel import behavior (2004) Suggestions (1998) Doesn't change (WebCat 4.0) (2000) Change Subtotal (2000) Search returns all, not 20 (1997) show all problem (1997) Interfacing WebMerchant to www.fedex.com (1997) Text in coloums... (2000) Protect vs Authenicate (1997) webcat NT with [dos] command (1997) How old am I? (2004) Authentication Help (2000) [UPPERCASE] (1997)