这些是我的购物车页面上的代码。如果我更新数量,总价格将增加但不增加或减少。如何在我的购物车页面中更新我的更新数量?
<tr align="center">
<td> <button name="remove[]" onclick="returnshow_confirm();" value="<?php echo $prod_id; ?>">Remove </button></td>
<td><?php echo $prod_name; ?><br /> <img src="images/<?php echo $prod_image; ?>" width="60" height="60" /></td>
<td><input type="text" size="4" name = "qty" value = "" /></td>
<-- here are the part of update--->
<?php
if(isset($_POST['qty'])){
$asd = $_POST['qty'];
$update_qty = "update cart set qty = '$asd'";
$run_qty = mysqli_query($con, $update_qty);
$_SESSION['qty'] = $qty;
$total = $total*$qty;
echo "<script>windows.open('cart.php',_self)</script>";
}
<--- to here --->
?>
<td><?php echo "Php ".$single_price; ?></td>
</tr>*/
添加或减去什么?什么应该工作? –
产品的数量。该用户从产品页面订购。如果客户想要更改数量。它会增加或减少。 – Michael