Пример #1
0
 /**
  * Stub method to prevent filters being applied. Klevu handles all filtering.
  *
  * @param Mage_Catalog_Model_Layer_Filter_Attribute $filter
  * @param int $value
  * @return $this|Mage_Catalog_Model_Resource_Layer_Filter_Attribute
  */
 public function applyFilterToCollection($filter, $value)
 {
     // If the Klevu module is not configured/enabled, run the parent method.
     if (!Mage::helper('klevu_search/config')->isExtensionConfigured() || !Mage::helper('klevu_search')->isCatalogSearch()) {
         parent::applyFilterToCollection($filter, $value);
     }
     return $this;
 }
Пример #2
0
 /**
  * Apply attribute filter to product collection
  *
  * @param Mage_Catalog_Model_Layer_Filter_Attribute $filter
  * @param int $value
  * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Layer_Filter_Attribute
  */
 public function applyFilterToCollection($filter, $value)
 {
     if (!Mage::helper('searchanise/ApiSe')->checkSearchaniseResult(true)) {
         return parent::applyFilterToCollection($filter, $value);
     }
     $collection = $filter->getLayer()->getProductCollection();
     if (!method_exists($collection, 'checkSearchaniseResult') || !$collection->checkSearchaniseResult()) {
         return parent::applyFilterToCollection($filter, $value);
     }
     // Disable internal attribute filter.
     return $this;
 }