websiteRepository = $websiteRepository; $this->groupRepository = $groupRepository; $this->storeRepository = $storeRepository; } /** * @inheritdoc */ public function getAllowedStoreIds($scopeCode) { $stores = []; $website = $scopeCode ? $this->websiteRepository->get($scopeCode) : $this->websiteRepository->getDefault(); foreach ($this->storeRepository->getList() as $store) { if ($store->getIsActive()) { if (($scopeCode && $store->getWebsiteId() == $website->getId()) || (!$scopeCode)) { $stores[$store->getId()] = $store->getId(); } } } sort($stores); return $stores; } /** * @inheritdoc */ public function getDefaultStoreId($scopeCode) { $website = $scopeCode ? $this->websiteRepository->get($scopeCode) : $this->websiteRepository->getDefault(); return $this->groupRepository->get($website->getDefaultGroupId())->getDefaultStoreId(); } }