Merge pull request #1090 from shreesh-webkul/gli-1876

Fixed: cart rule restricted to a single customer is accessable to all customer when group restriction is applied
This commit is contained in:
Rohit Jain
2024-06-04 19:50:47 +05:30
committed by GitHub

View File

@@ -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);