-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Customer Group Type and RuleChecker #6374
Fix Customer Group Type and RuleChecker #6374
Conversation
@@ -39,7 +39,11 @@ public function isEligible(PromotionSubjectInterface $subject, array $configurat | |||
return false; | |||
} | |||
|
|||
if ($configuration['groups'] === $customer->getGroup()->getId()) { | |||
if (is_null($customer->getGroup())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the following convention for checking for null
value: if (null === $customer->getGroup()) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright, changed
return false; | ||
} | ||
|
||
if ($configuration['group'] === $customer->getGroup()->getId()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use code
, same as we do in TaxonRuleChecker
(can be done in a separate PR).
Thanks @tchapi! Regarding using the code, we can handle that in a separate PR or when covering this functionality with scenarios. |
Yes, that's what I thought too because it's not really related to this PR in particular |
…le-checker Fix Customer Group Type and RuleChecker
Fix the CustomerGroupType and RuleChecker