want to minus the quantity when click delete if cart qty is more then 1
//remove item from shopping cart
if(isset($_GET["removep"]) && isset($_GET["return_url"]) && isset($_SESSION["products"])){
$product_code = $_GET["removep"]; //get the product code to remove
$product_s = $_GET["removes"]; //get the product size to remove
$return_url = base64_decode($_GET["return_url"]); //get return url
foreach ($_SESSION["products"] as $key=>$cart_itm){ //loop through session array var
if($cart_itm["id"] !=$product_code || $cart_itm["size"] !=$product_s){ //item does,t exist in the list
$product[] =array(
'name'=>$cart_itm["name"],
'id'=>$cart_itm["id"],
'size'=>$cart_itm["size"],
'qty'=>$cart_itm["qty"],
'price'=>$cart_itm["price"]);
}
//create a new product list for cart
$_SESSION["products"] = $product;
}
//redirect back to original page
header('Location:'.$return_url);
}
this code is deleting the product but i want minus also when qty is greater then 1