Forums

This topic is locked

"Add to cart" question-Duplicate products

Posted 05 Nov 2002 23:39:29
1
has voted
05 Nov 2002 23:39:29 Peter Lent posted:
Hi,

I have a custom ecommerce site that I am working on. One of the issues I need to resolve is duplicate entries of the same product to the shopping cart.

When a person adds an item "to the cart" the system adds a record into the DB file with sessionID, prod_id, size, etc.

My shopping cart page pulls the customers order based on sessionID. The problem I am having is that the customer can go back to the products page and add the same item multiple times. In the shopping cart, each entry has its own record, instead of changing the qty field.

I am looking for some suggestions as to the logic/code structure to use on my addtocart page.

Something like if there is a record in the DB file for product xyz, then update they quantity field, if not create a new record.

eagerly waiting suggestions.....

THANKS

-Peter

Reply to this topic