SEPETE EKLENEN yi bir artırmada başarıszlık
nerde hata yapıyrum.
products[id] pro_item[] içinde mevcut ise siparisadedi 1 artır.
eklenen a-siparis => 1 bu kısmı artıramadım nerde hata yapıyorum
yardımcı olursanız sevinirim
PHP KODLAR
function addToCart($product_item){
// $islem = $_POST["p"];
//$siparis_adet =0;
$product_id = $_POST["product_id"];
//if(empty($product_id)){siparis_adet =0;}
if(isset($_SESSION["shoppingCart"])){
$shoppingCart = $_SESSION["shoppingCart"];
$products = $shoppingCart["products"] ;
} else {
$products = array();
}
//ADET KONTROLÜ
$siparis_adet= 1;
if(in_array($product_item[id],$products[id])){
//$products[$product_item][id]count++;
// echo $product_item[id]."products dizinsinde";
$siparis_adet =$siparis_adet ++;
$products[id]["a-siparis"]= $siparis_adet ;
echo '<strong style="color:red;">item producte</strong>';
}else {
/*$products[]= $shoppingCart["products"];
$products[id] = $product_item; */ //çalışıyor
$products[$product_item]= $product_item;
$products[id] = $product_item;
$products[id]["a-siparis"]=$siparis_adet;
}
$_SESSION["shoppingCart"]["products"] = $products;
/*
print_r($products[id]);
print_r($product_item[id]);*/
// echo $product_item[id]."<br>";
//echo $products[id][0];
print_r($products[id]);
// print_r($_SESSION);DİZİDEde eklenen a-siparis => 1 bu kısmı artıramadım nerde hata yapıyorumCONSOL ÇIKTI
du] => TA4 [2] => Tepsi Altı Fiyatları [Kategori] => Tepsi Altı Fiyatları [3] => 4400 [uretim_fiyat] => 4400 [4] => 8500 [satis_fiyat] => 8500 [5] => 283 [dolarFiyat] => 283 [6] => 70 gr. Birinci Hamur - Ön 4 Renk Arka Yok -Selefon Yok [aciklama] => 70 gr. Birinci Hamur - Ön 4 Renk Arka Yok -Selefon Yok [7] => 5000 [adet] => 5000 [8] => - [selefon] => - [9] => 30x42 [ebat] => 30x42 [10] => 128 [kat_id] => 128 [11] => [resim] => [13] => 0 [uretimDurum] => 0 [a-siparis] => 1 ) Temalar/bootstraps44/cart_db.php:1 Failed to load resource: the server responded with a status of 404 () custom.js:14 <strong style="color:red;">item producte</strong>Array ( [0] => 92 [id] => 92 [1] => TA4 [urunKodu] => TA4 [2] => Tepsi Altı Fiyatları [Kategori] => Tepsi Altı Fiyatları [3] => 4400 [uretim_fiyat] => 4400 [4] => 8500 [satis_fiyat] => 8500 [5] => 283 [dolarFiyat] => 283 [6] => 70 gr. Birinci Hamur - Ön 4 Renk Arka Yok -Selefon Yok [aciklama] => 70 gr. Birinci Hamur - Ön 4 Renk Arka Yok -Selefon Yok [7] => 5000 [adet] => 5000 [8] => - [selefon] => - [9] => 30x42 [ebat] => 30x42 [10] => 128 [kat_id] => 128 [11] => [13] => 0 [uretimDurum] => 0 [a-siparis] => 1 ) Temalar/bootstraps44/cart_db.php:1 Failed to load resource: the server responded with a status of 404 () custom.js:14 <strong style="color:red;">item producte</strong>Array ( [0] => 92 [id] => 92 [1] => TA4 [urunKodu] => TA4 [2] => Tepsi Altı Fiyatları [Kategori] => Tepsi Altı Fiyatları [3] => 4400 [uretim_fiyat] => 4400 [4] => 8500 [satis_fiyat] => 8500 [5] => 283 [dolarFiyat] => 283 [6] => 70 gr. Birinci Hamur - Ön 4 Renk Arka Yok -Selefon Yok [aciklama] => 70 gr. Birinci Hamur - Ön 4 Renk Arka Yok -Selefon Yok [7] => 5000 [adet] => 5000 [8] => - [selefon] => - [9] => 30x42 [ebat] => 30x42 [10] => 128 [kat_id] => 128 [11] => [resim] => [13] => 0 [uretimDurum] => 0 [a-siparis] => 1 ) Temalar/bootstraps44/cart_db.php:1 Failed to load resource: the server responded with a status of 404 () custom.js:14 <strong style="color:red;">item producte</strong>Array ( [0] => 92 [id] => 92 [1] => TA4 [urunKodu] => TA4 [2] => Tepsi Altı Fiyatları [Kategori] => Tepsi Altı Fiyatları [3] => 4400 [uretim_fiyat] => 4400 [4] => 8500 [satis_fiyat] => 8500 [5] => 283 [dolarFiyat] => 283 [6] => 70 gr. Birinci Hamur - Ön 4 Renk Arka Yok -Selefon Yok [aciklama] => 70 gr. Birinci Hamur - Ön 4 Renk Arka Yok -Selefon Yok [7] => 5000 [adet] => 5000 [8] => - [selefon] => - [9] => 30x42 [ebat] => 30x42 [10] => 128 [kat_id] => 128 [11] => [13] => 0 [uretimDurum] => 0 [a-siparis] => 1 )