Jump to content

An updateable shopping cart, using PHP sessions to store the cart.


snow

Recommended Posts

Hi guys,

 

I'm new at PHP, and currently for university I am undertaking a project with the objective to create "An updateable shopping cart, using PHP sessions to store the cart." Obviously this is too much for anyone to just 'help' me do, so I was wondering whether anyone here could suggest a helpful guide that would help me to understand how to create this.

 

Any help would be much appreciated, thanks in advance.

 

Edit: and yes sorry I forgot to mention I have been looking around on google but haven't found anything really helpful!

You could have a code that generates a random string of letters/numbers that would be a session id for taht user.  You of course would then set the session as maybe $_SESSION[cart_id] = $string.  Then at the top of your update cart page, just get the users session.  You would then have a table that would be called "cart items" that would look like this:

 

itemID

cartID

 

then when the user clicks on add item or something, make the link something like additem.php?item=$itemid (you would use $_GET['item'] to get $itemid).  Then you just insert the item and the session id's into the database.

 

Hope that helps.

 

ive been doing something to. I followed the tutiroil

Go to google and google plaincart

its very good example. comes with admin control but im having session problems with it. But if your not gonna move it into html u shouldnt have no problems.

 

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.