Example #1
0
<?php

$E = new CartEngine();
$ProdID = $_GET["id"];
$ProdQty = $_GET["qty"];
$res = $E->editCart($ProdID, $ProdQty);
echo json_encode(array("success" => $res));
Example #2
0
<?php

$E = new CartEngine();
$F = new ShopEngine();
$res = $E->viewCart();
$arr = array(0 => FALSE);
if ($res != FALSE) {
    $arr[0] = TRUE;
    foreach ($res as $item) {
        $item_info = $F->getProductDetails($item["PROD_ID"]);
        $tmp = array("PRODUCT_ID" => $item_info->getProductID(), "PRODUCT_NAME" => $item_info->getProductName(), "PRODUCT_PRICE" => $item_info->getProductPrice(), "PRODUCT_QTY" => $item["QTY"]);
        $arr[] = $tmp;
    }
} elseif ($res == array()) {
    $arr[0] = TRUE;
} else {
    $arr[0] = FALSE;
}
echo json_encode($arr);
Example #3
0
<?php

$E = new CartEngine();
$ProdID = $_GET["id"];
$res = $E->delItemCart($ProdID);
echo json_encode(array("success" => $res));
Example #4
0
<?php

$E = new CartEngine();
$res = $E->clearCart();
echo json_encode(array("success" => $res));
Example #5
0
<?php

$E = new CartEngine();
$ProdID = $_GET["id"];
$ProdQty = $_GET["qty"];
$res = $E->addToCart($ProdID, $ProdQty);
echo json_encode(array("success" => $res));
Example #6
0
<?php

$E = new CartEngine();
$res = $E->isHasItem($_GET["id"]);
$arr = array(0 => FALSE);
if ($res != FALSE) {
    $arr[0] = TRUE;
} else {
    $arr[0] = FALSE;
}
echo json_encode($arr);