From 226dcc49d90a215fa262125db9ecbe97f9526856 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Tue, 28 May 2024 18:57:01 +0530 Subject: [PATCH] Fixed: cart rule restricted to a single customer is accessable to all coustomer --- classes/CartRule.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/classes/CartRule.php b/classes/CartRule.php index f48ffb3b1..473d1bd0f 100644 --- a/classes/CartRule.php +++ b/classes/CartRule.php @@ -294,6 +294,13 @@ class CartRuleCore extends ObjectModel return array(); } + // Remove cart rule that does not match the id_customer + foreach ($result as $key => $cart_rule) { + if ($cart_rule['id_customer'] && $cart_rule['id_customer'] != $id_customer) { + unset($result[$key]); + } + } + // Remove cart rule that does not match the customer groups $customerGroups = Customer::getGroupsStatic($id_customer);