burayada sürekli yardım konusu açıyorum kusura bakmayın
sessionda vaar ıolan ürünleri listesini $products tutuyorum. post edilen $product_id1 = $_POST["product_id"]; değişkeni array_key_exists aracılığı ile var ise
unset($products[$product_id1 ]) ürün idsini ve ürünü silemedim.
DİZİ YAPISIDA
/* session shoppingCart products kedi maması ...2... 100.....200 köpek maması ...2....1000....2000 summary adet ürün 400 //////////////////////////////////////////
function removeFromCart($product_id){
//include("ust.php");
session_start();
//echo"removeFromCart";
echo $product_id1 = $_POST["product_id"];
$shoppingCart = $_SESSION["shoppingCart"];
$products = $shoppingCart["products"];
echo "<pre>";
// print_r($_SESSION);
print($products[$product_id1]['id']);
echo "</pre>";/**/
if (array_key_exists($product_id1, $products)) {
// Ürün zaten varsa, adedini artır
// $products[$product_id_key]['a-siparis'] += $siparis_adet;
// echo '<strong style="color:red;">Ürün adedi artırıldı</strong>';
unset($products[$product_id1 ]) ;
// print_r($products[1]);
/*
unset($products[$product_id1 ]);*/
} else {echo 'malisef';}
//unset ($shopping_products[$product_id1]);
//session_destroy();
// include("alt.php");
}
