Jump to content

Help with Shopping Cart


grungefreak

Recommended Posts

I am trying to create a shopping cart. Here is what I have done so far.

  • Users select a book from a list of titles (pulled from a mysql db - this is a hyperlink
  • The book details are appended as a query string and the full book details are presented on the next page e.g. isbn, title, price etc
  • The user can then press "Save to Cart" and the book details are saved in the session super global variable and presented to the user on a different page e.g. you just added this book to your cart [/i]

 

That's as far as I have got.

 

I am looking for high level or logical advice on how to achieve the following:

 

The user will also see a  link "continue shopping" which brings them back to the original list of books.

 

I want to somehow save what was selected already and the unset the session variables so the user can start again. Each time they get beyond the "save to cart" page, they will be presented with all the items they have selected thus far. I am thinking maybe I should use an array e.g. $cart_array or something? I don't think I should save yet to the database until the "checkout" page.

 

If you require further clarification please let me know. Any guidance at a high level would be most appreciated.

 

In summary, how do I store what I have registered in my session variables so that I can empty these variables to allow them be filled again?

 

GF

Link to comment
https://forums.phpfreaks.com/topic/167848-help-with-shopping-cart/
Share on other sites

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.