From 6b7bcb907659e4e63f669ffa09d926780048cf37 Mon Sep 17 00:00:00 2001 From: Bozhidar Slaveykov Date: Mon, 9 May 2022 12:31:50 +0300 Subject: [PATCH] Update CartManager.php --- src/MicroweberPackages/Cart/CartManager.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/MicroweberPackages/Cart/CartManager.php b/src/MicroweberPackages/Cart/CartManager.php index 3addd09d354..0b87b9f7be8 100644 --- a/src/MicroweberPackages/Cart/CartManager.php +++ b/src/MicroweberPackages/Cart/CartManager.php @@ -409,6 +409,12 @@ public function update_item_qty($data) if (!isset($data['qty'])) { return array('error' => _e('Invalid data', true)); } + + $data['qty'] = intval($data['qty']); + if ($data['qty'] < 1) { + return array('error' => _e('Invalid product quantity', true)); + } + $data_fields = false; $cart = array();