21 \Magento\Framework\DataObject\IdentityInterface
93 \
Magento\Catalog\Model\CategoryFactory $categoryFactory,
95 \
Magento\Catalog\Model\Layer\Resolver $layerResolver,
102 $this->_productCollectionFactory = $productCollectionFactory;
103 $this->_catalogLayer = $layerResolver->get();
105 $this->_catalogCategory = $catalogCategory;
108 $this->_categoryInstance = $categoryFactory->create();
109 parent::__construct($context,
$data);
119 'cache_lifetime' =>
false,
132 return $this->_registry->registry(
'current_category');
143 'CATALOG_NAVIGATION',
144 $this->_storeManager->getStore()->getId(),
145 $this->_design->getDesignTheme()->getId(),
146 $this->httpContext->getValue(Context::CONTEXT_GROUP),
151 $cacheId = $shortCacheId;
153 $shortCacheId = array_values($shortCacheId);
154 $shortCacheId = implode(
'|', $shortCacheId);
155 $shortCacheId = md5($shortCacheId);
158 $cacheId[
'short_cache_id'] = $shortCacheId;
170 if (!$this->_currentCategoryKey) {
171 $category = $this->_registry->registry(
'current_category');
173 $this->_currentCategoryKey =
$category->getPath();
175 $this->_currentCategoryKey = $this->_storeManager->getStore()->getRootCategoryId();
187 public function getCurrentChildCategories()
189 $categories = $this->_catalogLayer->getCurrentCategory()->getChildrenCategories();
235 return $this->_catalogLayer->getCurrentCategory();
getCategoryUrl($category)
getUrl($route='', $params=[])
isCategoryActive($category)
$_productCollectionFactory
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Model\Layer\Resolver $layerResolver, \Magento\Framework\App\Http\Context $httpContext, \Magento\Catalog\Helper\Category $catalogCategory, \Magento\Framework\Registry $registry, \Magento\Catalog\Model\Indexer\Category\Flat\State $flatState, array $data=[])