hasData('raw_groups')) { $websiteGroups = $this->_storeManager->getWebsite()->getGroups(); $groups = []; foreach ($websiteGroups as $group) { $groups[$group->getId()] = $group; } $this->setData('raw_groups', $groups); } return $this->getData('raw_groups'); } /** * Get raw stores. * * @return array */ public function getRawStores() { if (!$this->hasData('raw_stores')) { $websiteStores = $this->_storeManager->getWebsite()->getStores(); $stores = []; foreach ($websiteStores as $store) { /* @var $store \Magento\Store\Model\Store */ if (!$store->isActive()) { continue; } $localeCode = $this->_scopeConfig->getValue( Data::XML_PATH_DEFAULT_LOCALE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store ); $store->setLocaleCode($localeCode); $params = ['_query' => []]; if (!$this->isStoreInUrl()) { $params['_query']['___store'] = $store->getCode(); } $baseUrl = $store->getUrl('', $params); $store->setHomeUrl($baseUrl); $stores[$store->getGroupId()][$store->getId()] = $store; } $this->setData('raw_stores', $stores); } return $this->getData('raw_stores'); } }