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:
Lineitems [text*] (2004)
I'm new be kind (1997)
Make sure I understand this??? (1997)
[DOS]/DOS query perhaps OT (2003)
Re:Emailer and encryption (1997)
Webmerchant confirmation hooks? (1997)
[append] vs. [appendfile] delta + question? (1997)
can webcat determine an image's pixel dimensions? (2000)
Error: Too many nested [xxx] contexts (1997)
String manipulation in Webcatalog (2001)
hideif [x]=1,2,3.. (2003)
Domain serial issue (2008)
[WebDNA] [OT] Free Windows FTP client recommendations (2009)
Multiple serial numbers (1997)
[WebDNA] Styling search results [using css] (2009)
File Upload (1997)
WebCat2 several catalogs? (1997)
Public beta 2 for WebCatalog 4.0 is now available. (2000)
WebMerchant - MacAuthorize (1999)
Format of Required fields error message (1997)