I am creating a PHP cart for a photography business. This is the 1st Ecommerce site I have attempted (Newbie)
I have managed to add products to the cart (stored in the session) (Products: Print, Keyring, Magnet ect)
However I also need to add the imageID to the session
Here is my code
$product_id = $_GET[id]; //the product id from the URL
$imageId = $_GET[imageid]; //the image id from the URL
$action = $_GET[action]; //the action from the URL
switch($action) { //decide what to do
case "add":
$_SESSION['cart'][$product_id]++; //add one to the quantity of the product with id $product_id
break;
Which saves the product to the basket
The cart.php url is shown as:
cart.php?imageid=83&id=12&action=add
Could anyone help/advise how I add the Image ID to the product?
Thanks