Jump to content

Shopping Cart Question


smartin1017

Recommended Posts

Hi guys, I have a question about a shopping cart. I am about to try and build one but am hearing diffrent ways to do it and wanted to get some advice. Some are saying to use a cookie to store the ids of the items and just have the cookie last forever, some are saying to use a cookie to store a unique id generated from a database and have the DB store the items and some are saying to ask for an email address and password.

 

What do you guys think, there are pros and cons to all of them in my mind. I would like to get your opinions.

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/146180-shopping-cart-question/
Share on other sites

You'd have to use cookies whichever way you do it.

If it were me, I'd require users to log in each time they purchase something.

Then, when they add something to their cart, store the ID of the item in an encrypted cookie, and when they go to the checkout, you can grab the ID(s) from the cookie, and get the corresponding item(s) from the database.

:)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.