Skip to content

Commit

Permalink
fix: apply cart's customer group to discount manager
Browse files Browse the repository at this point in the history
  • Loading branch information
se09deluca committed Jan 27, 2025
1 parent 467b497 commit 0843412
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/Managers/DiscountManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ public function getDiscounts(Cart $cart = null): Collection
$this->channel($defaultChannel);
}

if ($cart && $customerGroups = $cart->customer?->customerGroups) {
$this->customerGroup($customerGroups);
}

if ($this->customerGroups->isEmpty() && $defaultGroup = CustomerGroup::getDefault()) {
$this->customerGroup($defaultGroup);
}
Expand Down

0 comments on commit 0843412

Please sign in to comment.