From d8a9c83fbb1fcd7a1b775241fbe44f8ecb759b67 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 11 Mar 2024 10:25:25 +0530 Subject: [PATCH] Fixed: Admin is able to add/update the quantity of auto added service products --- controllers/admin/AdminNormalProductsController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/controllers/admin/AdminNormalProductsController.php b/controllers/admin/AdminNormalProductsController.php index b9c184cdc..2cefdc7a3 100644 --- a/controllers/admin/AdminNormalProductsController.php +++ b/controllers/admin/AdminNormalProductsController.php @@ -1746,6 +1746,10 @@ class AdminNormalProductsControllerCore extends AdminController $this->object = new $this->className(); $this->_removeTaxFromEcotax(); + if (Tools::getValue('auto_add_to_cart')) { + $_POST['allow_multiple_quantity'] = 0; + } + $this->copyFromPost($this->object, $this->table); $this->object->service_product_type = Product::SERVICE_PRODUCT_WITH_ROOMTYPE; @@ -1884,6 +1888,9 @@ class AdminNormalProductsControllerCore extends AdminController /** @var Product $object */ $object = new $this->className((int)$id); $this->object = $object; + if (Tools::getValue('auto_add_to_cart')) { + $_POST['allow_multiple_quantity'] = 0; + } if (Validate::isLoadedObject($object)) { $this->_removeTaxFromEcotax();