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
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.

:)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.