コード例 #1
0
ファイル: Abstract.php プロジェクト: victorkho/telor
 public function prepare()
 {
     $this->filter->setTemplate($this->setTemplate());
     $this->filter->setCollapsed($this->setCollapsed());
     $this->filter->setHasSelection($this->setHasSelection());
     $this->filter->setPosition($this->setPosition());
 }
コード例 #2
0
ファイル: Stock.php プロジェクト: xiaoguizhidao/tyler-live
 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;
 }
コード例 #3
0
 /**
  * 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');
 }
コード例 #4
0
 /** 
  * 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();
 }
コード例 #5
0
 /**
  * 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();
 }
コード例 #6
0
ファイル: Links.php プロジェクト: xiaoguizhidao/magento
 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');
 }
コード例 #7
0
ファイル: Abstract.php プロジェクト: rcclaudrey/dev
 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());
 }
コード例 #8
0
ファイル: Attribute.php プロジェクト: hyhoocchan/mage-local
 /**
  * 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;
 }
コード例 #9
0
ファイル: Abstract.php プロジェクト: xiaoguizhidao/devfashion
 /**
  * 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;
 }
コード例 #10
0
ファイル: Stock.php プロジェクト: vstorm83/ausport
 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();
 }
コード例 #11
0
ファイル: Attribute.php プロジェクト: natxetee/magento2
 protected function _construct()
 {
     parent::_construct();
     $this->_filterModelName = 'Mage_Catalog_Model_Layer_Filter_Attribute';
 }
コード例 #12
0
ファイル: Filter.php プロジェクト: rubenjohne/ts-echo
 /** 
  * 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();
 }
コード例 #13
0
ファイル: Textfield.php プロジェクト: CherylMuniz/fashion
 /**
  * Initialize Textfield filter module
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->_filterModelName = 'catalog/layer_filter_textfield';
 }
コード例 #14
0
ファイル: Attribute.php プロジェクト: javik223/Evron-Magento
 /**
  * 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';
 }
コード例 #15
0
 /**
  * overide filter model name.
  */
 public function __construct()
 {
     parent::__construct();
     $this->_filterModelName = 'elasticgento/catalog_layer_filter_category';
 }
コード例 #16
0
ファイル: Price.php プロジェクト: relue/magento2
 /**
  * Initialize Price filter module
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->_filterModelName = 'Mage_Catalog_Model_Layer_Filter_Price';
 }
コード例 #17
0
ファイル: Decimal.php プロジェクト: javik223/Evron-Magento
 /**
  * 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';
 }
コード例 #18
0
 /**
  * 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;
 }
コード例 #19
0
ファイル: Sale.php プロジェクト: Gobbob/Inchoo_Sale
 public function __construct()
 {
     parent::__construct();
     $this->_filterModelName = 'inchoo_sale/catalog_layer_filter_sale';
 }
コード例 #20
0
 public function __construct()
 {
     parent::__construct();
     $this->_filterModelName = 'holoflek_filters/layer_filter_category';
     $this->setTemplate('holoflek/filters/layer/categoryfilter.phtml');
 }
コード例 #21
0
 /**
  * Set model name
  */
 protected function _construct()
 {
     parent::_construct();
     $this->_filterModelName = 'enterprise_search/search_layer_filter_attribute';
 }
コード例 #22
0
ファイル: Category.php プロジェクト: hazaeluz/magento_connect
 public function __construct()
 {
     parent::__construct();
     $this->_filterModelName = 'catalog/layer_filter_category';
 }
コード例 #23
0
ファイル: Category.php プロジェクト: technomagegithub/norma
 /**
  * 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';
 }
コード例 #24
0
 /**
  * Initialize Price filter module
  */
 public function __construct()
 {
     parent::__construct();
     $this->_filterModelName = 'elasticsearch/catalog_layer_filter_price';
 }
コード例 #25
0
 /**
  * Block init
  *
  * @return Smile_ElasticSearch_Block_Catalog_Layer_Filter_Attribute_Suggest
  */
 protected function _prepareLayout()
 {
     $this->_layerBlock = $this->_getLayerBlock();
     return parent::_prepareLayout();
 }
コード例 #26
0
ファイル: Price.php プロジェクト: javik223/Evron-Magento
 public function rebuildFilter()
 {
     parent::_prepareLayout();
 }
コード例 #27
0
ファイル: Decimal.php プロジェクト: jpbender/mage_virtual
 /**
  * Initialize Decimal Filter Model
  */
 public function __construct()
 {
     parent::__construct();
     $this->_filterModelName = 'enterprise_search/catalog_layer_filter_decimal';
 }
コード例 #28
0
ファイル: Option.php プロジェクト: santhosh400/ecart
 public function __construct()
 {
     parent::__construct();
     $this->_filterModelName = 'magetools_optionfilter/layer_option';
 }
コード例 #29
0
 /**
  * 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';
 }
コード例 #30
0
 public function __construct()
 {
     parent::__construct();
     $this->_filterModelName = 'mtfilter/layer_filter_discount';
 }