ciao,
alla fine di updateCart c'era un exit; ma l'ho disabilitato e non cambia nulla...
Codice PHP:
function updateCart()
{
$cartId = $_POST['hidCartId'];
$productId = $_POST['hidProductId'];
$itemQty = $_POST['txtQty'];
$numItem = count($itemQty);
$numDeleted = 0;
$notice = '';
for ($i = 0; $i < $numItem; $i++) {
$newQty = (int)$itemQty[$i];
if ($newQty < 1) {
// remove this item from shopping cart
deleteFromCart($cartId[$i]);
$numDeleted += 1;
} else {
// update product quantity
$sql = "UPDATE tbl_cart
SET ct_qty = $newQty
WHERE ct_id = {$cartId[$i]}";
dbQuery($sql);
}
}
if ($numDeleted == $numItem) {
// if all item deleted return to the last page that
// the customer visited before going to shopping cart
//header("Location: $returnUrl" . $_SESSION['shop_return_url']);
header('Location: home.php?page=cart');
} else {
header('Location: home.php?page=cart');
}
//exit;
}
le $var che passo via post non sono quelle all'inizio della funzione.
alla funzione query() dovrebbero arrivarne 2 solo per questa funzione