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 DavisWebmasterGray Loon Marketing Group812.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:
>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 DavisWebmasterGray Loon Marketing Group812.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:
[WebDNA] Getting to know ARRAY (2014)
Weird [blank] interpretation (1999)
Problem searching bw & ne of a word (1999)
Help! WebCat2 bug (1997)
Multiple prices (1997)
New Plug-in and Type 11 errors (1997)
using showpage and showcart commands (1996)
ANSWER to: CC Merchant suggestions?? (1997)
Thanks ! (1997)
Re[2]: 2nd WebCatalog2 Feature Request (1996)
Help formatting search results w/ table (1997)
Okay, I give up... (1999)
Re[3]: 2nd WebCatalog2 Feature Request (1996)
searching with groups (1997)
Calculating Shipping charges for multiple items and qtys > 1 (1997)
RE: Adding headers to email (1997)
(2000)
Search/sort in URL Was: GuestBook example (1997)
[WebDNA] How to use [function] (2012)
question... no field names? (2002)