芝麻web文件管理V1.00
编辑当前文件:/home/krishnamexports/public_html/ajax/addtoCartBulk.php
$status, 'msg'=>$msg); echo json_encode($arr); } else { $sizeArray = array(); for($j=0;$j
$productsize2[$j], "qty"=>$productqty[$j])); } if($status==0) { if(isset($_SESSION['kxproductList'])) { $_SESSION['kxproductListTemp'] = array(); $_SESSION['kxproductListAll'] = array(); for($i=0;$i
$productId, "qty"=>$qty, "polishId"=>"", "sizeId"=>$productsize[$i], "productName"=>$sqlProductData['name'], "productPrice"=>currencyPrice($sqlProductData['price']), "productPhoto"=>productDefaultPhoto($productId), "productSlugURL"=>$sqlProductData['slug_url'])); } foreach($_SESSION['kxproductList'] as $pL) { array_push($_SESSION['kxproductListAll'],array("productId" =>$pL['productId'], "qty"=>$pL['qty'], "polishId"=>$pL['polishId'], "sizeId"=>$pL['sizeId'], "productName"=>$pL['productName'], "productPrice"=>$pL['productPrice'], "productPhoto"=>$pL['productPhoto'], "productSlugURL"=>$pL['productSlugURL'])); } $productStatus = 1; foreach($_SESSION['kxproductListTemp'] as $pLT) { $search_items = array('productId'=>$pLT['productId'], 'polishId'=>$pLT['polishId'], 'sizeId'=>$pLT['sizeId']); $res = search($_SESSION['kxproductList'], $search_items); if(count(array_filter($res))==0) { $status = 4; $msg = "Enquiry List Updated Successfully."; array_push($_SESSION['kxproductListAll'],array("productId" =>$productId, "qty"=>$pLT['qty'], "polishId"=>$pLT['polishId'], "sizeId"=>$pLT['sizeId'], "productName"=>$pLT['productName'], "productPrice"=>$pLT['productPrice'], "productPhoto"=>$pLT['productPhoto'], "productSlugURL"=>$pLT['productSlugURL'])); } } $subTotal = 0; $deliveryCharges = 0; $orderTotal = 0; $_SESSION['kxproductList2'] = array(); foreach($_SESSION['kxproductListAll'] as $pL) { $sqlProduct2 = mysqli_query($cn,"select * from `tbl_product` where `id`='".$pL['productId']."'"); $sqlProductData2 = mysqli_fetch_array($sqlProduct2); $subTotal = $subTotal + ($pL['qty'] * $sqlProductData2['price']); $deliveryCharges = $deliveryCharges + $sqlProductData2['delivery_charge']; array_push($_SESSION['kxproductList2'],array("productId" =>$pL['productId'], "qty"=>$pL['qty'], "polishId"=>$pL['polishId'], "sizeId"=>$pL['sizeId'], "productName"=>$sqlProductData2['name'], "productPrice"=>currencyPrice($sqlProductData2['price']), "productPhoto"=>productDefaultPhoto($sqlProductData2['id']), "productSlugURL"=>$sqlProductData2['slug_url'])); } $_SESSION['kxproductList'] = array(); $_SESSION['kxproductList'] = $_SESSION['kxproductList2']; $orderTotal = $subTotal + $deliveryCharges; $arr = array('status'=>$status, 'msg'=>$msg, 'productCount'=>count($_SESSION['kxproductList']), 'subTotal'=>currencyPrice($subTotal), 'deliveryCharges'=>currencyPrice($deliveryCharges), 'orderTotal'=>currencyPrice($orderTotal), 'productList'=>$_SESSION['kxproductList']); echo json_encode($arr); } else { $_SESSION['kxproductList'] = array(); for($i=0;$i
$productId, "qty"=>$qty, "polishId"=>"", "sizeId"=>$productsize[$i], "productName"=>$sqlProductData['name'], "productPrice"=>currencyPrice($sqlProductData['price']), "productPhoto"=>productDefaultPhoto($productId))); } $subTotal = 0; $deliveryCharges = 0; $orderTotal = 0; $_SESSION['kxproductList2'] = array(); foreach($_SESSION['kxproductList'] as $pL) { $sqlProduct2 = mysqli_query($cn,"select * from `tbl_product` where `id`='".$pL['productId']."'"); $sqlProductData2 = mysqli_fetch_array($sqlProduct2); $subTotal = $subTotal + ($pL['qty'] * $sqlProductData2['price']); $deliveryCharges = $deliveryCharges + $sqlProductData2['delivery_charge']; array_push($_SESSION['kxproductList2'],array("productId" =>$pL['productId'], "qty"=>$pL['qty'], "polishId"=>$pL['polishId'], "sizeId"=>$pL['sizeId'], "productName"=>$sqlProductData2['name'], "productPrice"=>currencyPrice($sqlProductData2['price']), "productPhoto"=>productDefaultPhoto($sqlProductData2['id']), "productSlugURL"=>$sqlProductData2['slug_url'])); } $_SESSION['kxproductList'] = array(); $_SESSION['kxproductList'] = $_SESSION['kxproductList2']; $orderTotal = $subTotal + $deliveryCharges; $arr = array('status'=>$status, 'msg'=>$msg, 'productCount'=>count($_SESSION['kxproductList']), 'subTotal'=>currencyPrice($subTotal), 'deliveryCharges'=>currencyPrice($deliveryCharges), 'orderTotal'=>currencyPrice($orderTotal), 'productList'=>$_SESSION['kxproductList']); echo json_encode($arr); } } else { } } } else { $status = 5; $msg = "Somethig Went Wrong. Try Again."; $arr = array('status'=>$status, 'msg'=>$msg); echo json_encode($arr); } ?>