Skip to content

Commit

Permalink
Fixes customer group in Discounts
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirmturk committed Jan 1, 2025
1 parent 0366d02 commit c9db513
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/core/src/Managers/DiscountManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,12 @@ public function getDiscounts(?Cart $cart = null): Collection
$this->channel($defaultChannel);
}

if ($this->customerGroups->isEmpty() && $defaultGroup = CustomerGroup::getDefault()) {
$this->customerGroup($defaultGroup);
if ($this->customerGroups->isEmpty()) {
if ($customerGroups = $cart->customer?->customerGroups) {
$this->customerGroup($customerGroups);
} elseif ($defaultGroup = CustomerGroup::getDefault()) {
$this->customerGroup($defaultGroup);
}
}

return Discount::active()
Expand Down

0 comments on commit c9db513

Please sign in to comment.