Click here to Skip to main content
14,331,160 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,

I am creating an e-commerce website for my project. I completed most of it, but confused about one topic. How can I keep current shopping-cart data of user?


I think that if I created a table in database and shopping cart items are kept in that table until order finishes. Then, I can delete that item from the shopping cart table. In this case, if the user quits without giving order and enters the site later, his shopping cart will not be lost and he will continue his shopping.


Is this a good programming way(I mean efficent) or should I use something like memcache?

Thanks,
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

The normal ways are to either keep it in a database - in which case you will have to do regular checks to "sweep out" old, redundant data, or in cookies - in which case they sit on the user PC and can be set to expire naturally after a period of time - a week, or a month say.

Personally, I use cookies - it keeps the data with the user PC.
   
Comments
Çağlar Tolga Tetik 21-May-12 19:44pm
   
Ok. Thanks a lot. I think keeping in database will be easier for me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100