Jump to content


Photo

Cart System


  • Please log in to reply
3 replies to this topic

#1 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 28 October 2006 - 03:18 PM

I understand that to make a cart system i will need to use sessions and arrays but i'm not sure of how to put it all together.. would i make the "catolog" just be a big array and each "Add to Cart" button take that piece from the array to pass it on to the cart? is that how it works?

if so then when i pass that information on to the cart i would have to use the POST variable to apply that item that i got from the array, right? then how would i keep that information there when the customer leaves their cart to shop for more? could someone please tell me that and tell me if im right on this so far? thanks!

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 28 October 2006 - 03:23 PM

shopping carts are much easier than many make out. I would use a database for teh products and simply create an array with the product id as a key and iits value being the number of that prodcuct - assigin it to a sesion and hey presto you have a shopping cart.
follow me on twitter @PHPsycho

#3 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 28 October 2006 - 03:28 PM

i dont understand.. could you give me an example or piece of script that i could see?

#4 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 28 October 2006 - 03:47 PM

i just need to know how would i keep the data on one page so when they go back it will be there




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users