public function canShowBlock() { /** @var Enterprise_Search_Model_Resource_Engine $engine */ $engine = Mage::helper('catalogsearch')->getEngine(); if (method_exists($engine, 'isLayeredNavigationAllowed')) { $allowed = $engine->isLayeredNavigationAllowed(); } else { $allowed = $engine->isLeyeredNavigationAllowed(); } return $allowed && parent::canShowBlock(); }
public function canShowBlock() { if (!Mage::helper('amshopby')->isVersionLessThan(1, 4, 2)) { $_isLNAllowedByEngine = Mage::helper('catalogsearch')->getEngine()->isLeyeredNavigationAllowed(); if (!$_isLNAllowedByEngine) { return false; } } $availableResCount = (int) Mage::app()->getStore()->getConfig(Mage_CatalogSearch_Model_Layer::XML_PATH_DISPLAY_LAYER_COUNT); if (!$availableResCount || $availableResCount >= $this->getLayer()->getProductCollection()->getSize()) { return parent::canShowBlock(); } return false; }
public function canShowBlock() { if (version_compare(Mage::getVersion(), '1.4.2', '>=')) { $allowed = true; $engine = Mage::helper('catalogsearch')->getEngine(); // deprecated function name if (method_exists($engine, 'isLeyeredNavigationAllowed')) { $allowed = $engine->isLeyeredNavigationAllowed(); } else { $allowed = $engine->isLayeredNavigationAllowed(); } if (!$allowed) { return false; } } $availableResCount = (int) Mage::app()->getStore()->getConfig(Mage_CatalogSearch_Model_Layer::XML_PATH_DISPLAY_LAYER_COUNT); if (!$availableResCount || $availableResCount >= $this->getLayer()->getProductCollection()->getSize()) { return parent::canShowBlock(); } return false; }
protected function getCurrentCategoryId() { return $this->layer->getLayer()->getCurrentCategory()->getId(); }