/** * Check if category display mode is "Static Block Only" * For anchor category with applied filter Static Block Only mode not allowed * * @return bool */ public function isContentMode() { $category = $this->getCurrentCategory(); $res = false; if ($category->getDisplayMode() == \Magento\Catalog\Model\Category::DM_PAGE) { $res = true; if ($category->getIsAnchor()) { $state = $this->_catalogLayer->getState(); if ($state && $state->getFilters()) { $res = false; } } } return $res; }
public function testGetState() { $this->assertInstanceOf('\\Magento\\Catalog\\Model\\Layer\\State', $this->model->getState()); }
/** * Is filter enabled * * @param \Magento\Catalog\Model\Layer $layer * @param array $filters * @return bool */ public function isEnabled($layer, array $filters = []) { return $this->canShowOptions($filters) || count($layer->getState()->getFilters()); }