From 879c72e50c172f6e20416dcf06fccdbb59525c7a Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 1 Jun 2023 16:02:10 +0200 Subject: order from product catalogue and modify cart product count --- public/cart.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'public/cart.php') diff --git a/public/cart.php b/public/cart.php index 60f4c63..ba33a9d 100644 --- a/public/cart.php +++ b/public/cart.php @@ -27,18 +27,24 @@ $cart_count = get_cart_count(); break; } + case "update": { + $statement = $cursor->prepare("update orderproduct set count = ? where product = ? and `order` = cart(?)"); + $statement->bind_param("iii", $_POST['count'], $_POST['product_id'], $user_id); + $statement->execute(); + return; // update requests are only triggered from JS and don't do anything with the response + } } } while (false); ?> image ? "/img/product/$item->id-thumb.jpg" : "/img/placeholder.png"; echo <<<"EOF" -
+
productafbeelding $item->name - - + + $item->price
EOF; @@ -49,6 +55,7 @@ EOF; mand + @@ -75,7 +82,7 @@ EOF; break; } echo <<<"EOF" -
+ EOF; while ($product = $res->fetch_object()) item_template($product); -- cgit v1.2.3