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:
PIXO support (1997)
WebCat2 beta 11 - new prefs ... (1997)
Problem (1997)
Can I invoke an ssi plugin from within a webcat page (1997)
Quit revisited (1997)
calculating ShipCost depending on weight (1997)
WebCatalog can't find database (1997)
[url] link (1998)
Banner DNA (1997)
SSL and WebCatalog (1997)
unable to launch acgi in WebCat (1997)
emailer (1997)
categorys (1998)
[WebDNA] File Include HTM (2008)
WebCat2b13MacPlugIn - syntax to convert date (1997)
Multiple SSL Keys (1998)
I'm Baaaaaaaaaack - Questions! (2000)
[WebDNA] max in a search (2009)
Quit revisited (1997)
[WC 2.1.30] Stack overflow. (2000)