From da19c3788834acabb3d736549a3089de451ddfda Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 17 Jun 2025 11:13:04 +0530 Subject: [PATCH] Fixed: older product selection is saved in cart rule restriction if a specific room type option is selected --- controllers/admin/AdminCartRulesController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminCartRulesController.php b/controllers/admin/AdminCartRulesController.php index c1e98e27e..654933669 100644 --- a/controllers/admin/AdminCartRulesController.php +++ b/controllers/admin/AdminCartRulesController.php @@ -277,7 +277,10 @@ class AdminCartRulesControllerCore extends AdminController // If the reduction is associated to a specific product, then it must be part of the product restrictions if ((int)Tools::getValue('reduction_product') && Tools::getValue('apply_discount_to') == 'specific' && Tools::getValue('apply_discount') != 'off') { $reduction_product = (int)Tools::getValue('reduction_product'); - + // In case the product_restriction was unchecked then remove the older products. + if (!Tools::getValue('product_restriction')) { + $_POST['product_rule_group'] = array(); + } // First, check if it is not already part of the restrictions $already_restricted = false; if (is_array($rule_group_array = Tools::getValue('product_rule_group')) && count($rule_group_array) && Tools::getValue('product_restriction')) {