I hope someone can help me with some troubles I'm having. Currently I'm trying to make a simple webshop. First some information:
I have 2 kinds of products, product a and product b. Both of the products are available in 18 colours and 3 sizes. When you want to buy product a, you simply go to the page of product a, select your colour and your size, and then you add it to your basket.
The problem I'm having is that I can't manage to store the colour and size in the session as wel. Right now I'm storing the id of the product and the quantity in a session like this:
if (isset($_GET['add'])) {
$_SESSION['cart_'.(int)$_GET['add']]+='1';
}
The outcome of the session is: cart_1 1. It means that of the product with the ID 1, 1 has been added to the shopping basket. But what I want to do is that my session also can tell me which colour and size has been submitted. ($_POST['colour'] and $_POST['size']. The problem is that when I store it like this, I will only be able to order 1 of product a and 1 of product b because whenever I want to add another one of product a the 1 from cart_1 will be the same as the one with a different colour.
Thanks in advance!