diff --git a/packages/core/src/Managers/StorefrontSessionManager.php b/packages/core/src/Managers/StorefrontSessionManager.php index 04b8bc93db..3d1a66db12 100644 --- a/packages/core/src/Managers/StorefrontSessionManager.php +++ b/packages/core/src/Managers/StorefrontSessionManager.php @@ -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(), + ]) ); }