/** * Generate list of urls for global scope * * @return \Magento\UrlRewrite\Service\V1\Data\UrlRewrite[] */ protected function generateForGlobalScope() { $urls = []; $categoryId = $this->category->getId(); foreach ($this->category->getStoreIds() as $id) { if (!$this->isGlobalScope($id) && !$this->storeViewService->doesEntityHaveOverriddenUrlKeyForStore($id, $categoryId, Category::ENTITY)) { $urls = array_merge($urls, $this->generateForSpecificStoreView($id)); } } return $urls; }
/** * Generate list of urls for global scope * * @return \Magento\UrlRewrite\Service\V1\Data\UrlRewrite[] */ protected function generateForGlobalScope() { $urls = []; $categoryId = $this->category->getId(); foreach ($this->category->getStoreIds() as $storeId) { if (!$this->isGlobalScope($storeId) && $this->isOverrideUrlsForStore($storeId, $categoryId)) { $this->updateCategoryUrlForStore($storeId); $urls = array_merge($urls, $this->generateForSpecificStoreView($storeId)); } } return $urls; }
public function testGetStoreIds() { $this->_model = $this->getCategoryByName('Category 1.1'); /* id from fixture */ $this->assertContains(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore()->getId(), $this->_model->getStoreIds()); }
public function testGetStoreIds() { $this->_model->load(3); /* id from fixture */ $this->assertContains(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\StoreManagerInterface')->getStore()->getId(), $this->_model->getStoreIds()); }
/** * {@inheritdoc} */ public function getStoreIds() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getStoreIds'); if (!$pluginInfo) { return parent::getStoreIds(); } else { return $this->___callPlugins('getStoreIds', func_get_args(), $pluginInfo); } }
/** * Retrieve the category product sorter load URL. * * @param Category $category Category. * * @return string */ private function getProductSorterLoadUrl(Category $category) { $storeId = $category->getStoreId(); if ($storeId === 0) { $defaultStoreId = $this->storeManager->getDefaultStoreView()->getId(); $storeId = current(array_filter($category->getStoreIds())); if (in_array($defaultStoreId, $category->getStoreIds())) { $storeId = $defaultStoreId; } } $urlParams = ['ajax' => true, 'store' => $storeId]; return $this->urlBuilder->getUrl('virtualcategory/category_virtual/preview', $urlParams); }