Jump to content
Larry Ullman's Book Forums

Multiple Products With Same Print Id?


Recommended Posts

I'm trying to setup a cart system for a photography website. Ideally, there would be a set of photos, with a dropdown box to select various sizes, and a box to input the quantity. And ideally, people could add different sizes of the same photo and it would show up as a seperate product in the cart.

 

$_SESSION['cart'][$pid] = array ('qty' => $qty, 'product' => $product);

 

That code works, except will just override the previous product.

 

I need a unique session id or auto-incrementing ID so two products with the same print id can be added.

 

Thanks for any help in advance!

Link to comment
Share on other sites

In that case, I would have to have the same picture repeat 10 times. Instead, I'd like to have a picture listed once, with a dropdown for different size options. I would know how to fulfil the order because the selection in the dropdown with the print size would be attached to the order with the print id for that photo.

 

Another example: I want to sell a tshirt, but have different sizes available. I don't want to list the same tshirt 5 times - I want to list it once and allow a dropdown to select different sizes.

 

Thanks

Link to comment
Share on other sites

Right. That's the second example in the book, with coffee available in different sizes, grounds, and caf/decaf. Each variation gets a unique ID. Only by having unique IDs for each possible combination can you have a working shopping cart.

Link to comment
Share on other sites

 Share

×
×
  • Create New...