ASP Shopping Cart Cookies
Posted on 2006-05-26
I'm progressing steadily with my first e-commerce type website. I'm at the shopping cart phase now so some questions about this. My ASP Cookie knowledge is very rusty :-(
I'm going to use either the ASP Session object or Request.Cookies object for my cart. Whichever works the best in your opinion. What's the best way to store the products selected by the user? I don't want to use a database to store the shopping cart items! The info I need to store is for example:
piID - the unique identifier that identifies each product in the product database.
Quantitiy - the quantity of this product the user has selected
1) I would like the code to store each product added to the basket by the user. The script name is going to be 'basket_add.asp'. It will need to store in Cookies each product selected by the user, one call at a time as each product is added.
2) I would like the code to loop through the Cookies and get each product and quantity the user has in their basket. This script is going to be 'view_basket.asp'.
3) I would like to know how to determine if the shopping basket is empty.
Plenty of points available.
Thanks in advance,