Ok I am trying to build a shopping cart that i will allow people to use. I want to add it where they can have options like select a large, medium or small shirt. How should all of this be stored? I would like to find the best performance way. Here are some ways that I am thinking....
1. Store the items in a session array while the customer is browsing the site. when they checkout in the ORDERS table there is one column for the items they ordered which is inserted as a long string that is broke apart when viewing the order at a later date
2. When a users adds a item to a cart it creates them a unique id and is insert into a ShoppingUser table where the unique number, date, and other data. then another table called ShoppingTempItems. When an item is placed into a shopping cart it is inserted as one line in the ShoppingTempItems table which a reference number to their unique number that is in the ShoppingUser table. The unique number could be stored in a cookie or session for each user. Then when they check out a order is inserted into the ORDERS table and then each item would be inserted into a OrdersDeatiled table. This way all items could easy be available.
Do any of these sound like a good way to build it, or do you have another idea? Also has anyone built a ASP Shopping Cart before?
I would suggest you store them in a db not a session object, that why if your server dies or resets half way through someones shopping experience, they won't have to start again, so stick with 2)
Allow me to shake you by the hand, redbrad0. You endure the same terror as I! I'm currently wrestling/writing my own e-store and the database design aspect is making me tear my hear out - my minimal grasp of SQL isn't helping either!
Definately store the items in the database. You can have the customers basket deleted after some amount of time if the customer doesn't return to finish the order.