예제 #1
0
파일: Layer.php 프로젝트: victorkho/telor
 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();
 }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
 protected function getCurrentCategoryId()
 {
     return $this->layer->getLayer()->getCurrentCategory()->getId();
 }