public function prepare() { $this->filter->setTemplate($this->setTemplate()); $this->filter->setCollapsed($this->setCollapsed()); $this->filter->setHasSelection($this->setHasSelection()); $this->filter->setPosition($this->setPosition()); }
public function getItemsAsArray() { $items = array(); foreach (parent::getItems() as $itemObject) { $item = array(); $item['url'] = $this->htmlEscape($itemObject->getUrl()); $item['label'] = $itemObject->getLabel(); $item['count'] = ''; $item['countValue'] = $itemObject->getCount(); /** @todo Fix item counts */ if (!$this->getHideCounts()) { $item['count'] = ' (' . $itemObject->getCount() . ')'; } $item['css'] = 'amshopby-attr'; if (in_array($this->getDisplayType(), array(1, 3))) { //dropdown and images $item['css'] = ''; } if ($itemObject->getOptionId() == $this->getRequestValue()) { $item['css'] .= '-selected'; if (3 == $this->getDisplayType()) { //dropdown $item['css'] = 'selected'; } } $item['rel'] = $this->getSeoRel() ? ' rel="nofollow" ' : ''; if ($item['countValue']) { $items[] = $item; } } return $items; }
/** * Defines specific filter model name. * * @see Smile_ElasticSearch_Model_Catalogsearch_Layer_Filter_Attribute */ public function __construct() { parent::__construct(); $this->_filterModelName = 'smile_elasticsearch/catalogsearch_layer_filter_attribute'; $this->setIsMultipleSelect(true); $this->setTemplate('smile/elasticsearch/catalog/layer/filter.phtml'); }
/** * This function is typically called to initialize underlying model of filter and apply it to current * product set if needed. Here we leave it as is except that we assign template file here not in constructor, * not how standard Magento does. * @see Mage_Catalog_Block_Layer_Filter_Abstract::init() */ public function init() { /* @var $helper Mana_Filters_Helper_Data */ $helper = Mage::helper(strtolower('Mana_Filters')); $this->setTemplate((string) $this->getDisplayOptions()->template); $this->_filterModelName = $helper->getFilterTypeName('model', $this->getFilterOptions()); return parent::init(); }
/** * Prepare filter process * Add data to categoryLayered model instance * * @return Mage_Catalog_Block_Layer_Filter_Abstract */ public function _prepareFilter() { $category = Mage::getModel('catalog/category')->load($this->getData('categoryId')); if ($category->getId()) { $this->_filter->setRootCategory($category); } $this->_filter->setRequestVar($this->getData('requestParam')); return parent::_prepareFilter(); }
public function __construct() { parent::__construct(); if ($this->getDataHelper()->isEnabledThirdEngineSearch()) { $this->_filterModelName = 'itoris_layerednavigation/enterprise_layer_filter_category_links'; } else { $this->_filterModelName = 'itoris_layerednavigation/layer_filter_category_links'; } $this->setTemplate('itoris/layerednavigation/layer/filter/category/links.phtml'); }
public function prepare() { $this->filter->setTemplate($this->setTemplate()); $this->filter->setCollapsed($this->setCollapsed()); $this->filter->setHasSelection($this->setHasSelection()); $this->filter->setPosition($this->setPosition()); $this->filter->setData('hide_counts', !$this->_getDataHelper()->getIsCountGloballyEnabled()); }
/** * Get filter items count * * @return int */ public function getItemsCount() { $attributeIsFilterable = $this->getAttributeModel()->getIsFilterable(); if ($attributeIsFilterable == Mage_Catalog_Model_Layer_Filter_Attribute::OPTIONS_ONLY_WITH_RESULTS) { return parent::getItemsCount(); } $count = 0; foreach ($this->getItems() as $item) { if ($item->getCount()) { $count++; } } return $count; }
/** * Initialize filter model object * * @return Mage_Catalog_Block_Layer_Filter_Abstract */ public function init() { $attribute = $this->getAttributeModel(); $registryKey = $this->_filterModelName . ($attribute ? '_' . $attribute->getAttributeCode() : ''); $filter = Mage::registry($registryKey); if ($filter) { $this->_filter = $filter; $this->_prepareFilter(); } else { parent::_initFilter(); Mage::register($registryKey, $this->_filter); } return $this; }
public function getItems() { if (Mage::helper('gomage_navigation')->isGomageNavigation() && Mage::getStoreConfigFlag('gomage_navigation/stock/active')) { if (!$this->ajaxEnabled()) { $items = parent::getItems(); foreach ($items as $key => $item) { if ($category = Mage::getModel('catalog/category')->load($item->getValue())) { $items[$key]->setUrl($category->getUrl()); } } return $items; } } return parent::getItems(); }
protected function _construct() { parent::_construct(); $this->_filterModelName = 'Mage_Catalog_Model_Layer_Filter_Attribute'; }
/** * This function is typically called to initialize underlying model of filter and apply it to current * product set if needed. Here we leave it as is except that we assign template file here not in constructor, * not how standard Magento does. * @see Mage_Catalog_Block_Layer_Filter_Abstract::init() */ public function init() { $this->setTemplate((string) $this->getDisplayOptions()->template); $this->_filterModelName = (string) $this->getDisplayOptions()->model; return parent::init(); }
/** * Initialize Textfield filter module * */ public function __construct() { parent::__construct(); $this->_filterModelName = 'catalog/layer_filter_textfield'; }
/** * Specifies the filter model name. * * @see NanoWebG_ElasticSearch_Model_Catalogsearch_Layer_Filter_Attribute */ public function __construct() { parent::__construct(); $this->_filterModelName = 'nanowebg_elasticsearch/catalogsearch_layer_filter_attribute'; }
/** * overide filter model name. */ public function __construct() { parent::__construct(); $this->_filterModelName = 'elasticgento/catalog_layer_filter_category'; }
/** * Initialize Price filter module * */ public function __construct() { parent::__construct(); $this->_filterModelName = 'Mage_Catalog_Model_Layer_Filter_Price'; }
/** * Specifies the filter model name. * * @see NanoWebG_ElasticSearch_Model_Catalog_Layer_Filter_Decimal */ public function __construct() { parent::__construct(); $this->_filterModelName = 'nanowebg_elasticsearch/catalog_layer_filter_decimal'; }
/** * Returns true if the filter should be displayed * @param Mage_Catalog_Block_Layer_Filter_Abstract $filter * @param number $categoryId * @return bool */ public function displayFilter(Mage_Catalog_Block_Layer_Filter_Abstract $filter, $categoryId) { $inclusionFilterRules = $this->getFilterRules(self::RULES_TYPE_INCLUSION); $exclusionFilterRules = $this->getFilterRules(self::RULES_TYPE_EXCLUSION); $display = true; /** @var Mage_Catalog_Model_Resource_Eav_Attribute $attribute */ $attribute = $filter->getAttributeModel(); if (!$attribute) { return $display; } $code = $attribute->getAttributeCode(); // if there is a rule for this code, validate if (isset($inclusionFilterRules[$code])) { $display = false; $rules = $inclusionFilterRules[$code]; foreach ($rules as $rule) { // if there is not a value for the rule, then there is nothing to validate against and it has passed // if there is a value, then check that they match $ruleCategoryId = !$rule['category_id'] ? true : $rule['category_id'] == $categoryId; if ($ruleCategoryId) { $display = true; break; } } } if ($display == true && isset($exclusionFilterRules[$code])) { $rules = $exclusionFilterRules[$code]; foreach ($rules as $rule) { if ($rule['category_id'] == $categoryId) { $display = false; break; } } } return $display; }
public function __construct() { parent::__construct(); $this->_filterModelName = 'inchoo_sale/catalog_layer_filter_sale'; }
public function __construct() { parent::__construct(); $this->_filterModelName = 'holoflek_filters/layer_filter_category'; $this->setTemplate('holoflek/filters/layer/categoryfilter.phtml'); }
/** * Set model name */ protected function _construct() { parent::_construct(); $this->_filterModelName = 'enterprise_search/search_layer_filter_attribute'; }
public function __construct() { parent::__construct(); $this->_filterModelName = 'catalog/layer_filter_category'; }
/** * Defines specific filter model name. * * @see Bubble_Search_Model_Catalog_Layer_Filter_Category */ public function __construct() { parent::__construct(); $this->_filterModelName = 'bubble_search/catalog_layer_filter_category'; }
/** * Initialize Price filter module */ public function __construct() { parent::__construct(); $this->_filterModelName = 'elasticsearch/catalog_layer_filter_price'; }
/** * Block init * * @return Smile_ElasticSearch_Block_Catalog_Layer_Filter_Attribute_Suggest */ protected function _prepareLayout() { $this->_layerBlock = $this->_getLayerBlock(); return parent::_prepareLayout(); }
public function rebuildFilter() { parent::_prepareLayout(); }
/** * Initialize Decimal Filter Model */ public function __construct() { parent::__construct(); $this->_filterModelName = 'enterprise_search/catalog_layer_filter_decimal'; }
public function __construct() { parent::__construct(); $this->_filterModelName = 'magetools_optionfilter/layer_option'; }
/** * Defines specific filter model name. * * @see JR_Search_Model_Catalog_Layer_Filter_Attribute */ public function __construct() { parent::__construct(); $this->_filterModelName = 'jr_search/catalog_layer_filter_attribute'; }
public function __construct() { parent::__construct(); $this->_filterModelName = 'mtfilter/layer_filter_discount'; }