Skip to content

Commit

Permalink
fix: use session's customer groups correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
se09deluca committed Jan 7, 2024
1 parent 7f41cf6 commit 8207c3d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/core/src/Managers/StorefrontSessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,14 @@ public function initCustomerGroups()
return $this->customerGroups;
}

if (! $this->customerGroups?->count()) {
return $this->setCustomerGroups(
collect([
CustomerGroup::getDefault(),
])
);
if (count($groupHandles) > 0) {
return $this->customerGroups = CustomerGroup::whereIn('handle', $groupHandles)->get();
}

return $this->setCustomerGroups(
CustomerGroup::whereIn('handle', $groupHandles)->get()
collect([
CustomerGroup::getDefault(),
])
);
}

Expand Down

0 comments on commit 8207c3d

Please sign in to comment.