public function getIsExcluded() { if (!$this->model) { return true; } $moduleName = Mage::app()->getRequest()->getModuleName(); if (in_array($moduleName, array('sqli_singlesearchresult', 'catalogsearch'))) { return false; } $categoryId = $this->getCurrentCategoryId(); $exclude = false; $includeCategories = $this->model->getIncludeInArray(); if ($includeCategories) { if (!in_array($categoryId, $includeCategories)) { $exclude = true; } } if (!$exclude) { $excludeCategories = $this->model->getExcludeFromArray(); if (in_array($categoryId, $excludeCategories)) { $exclude = true; } } return $exclude; }
public function getIsExcluded() { if (!$this->model) { return true; } $moduleName = Mage::app()->getRequest()->getModuleName(); if (in_array($moduleName, array('sqli_singlesearchresult', 'catalogsearch'))) { return false; } $categoryId = $this->getCurrentCategoryId(); $exclude = false; /** @var Amasty_Xlanding_Model_Page $currentLanding */ $currentLanding = Mage::registry('amlanding_page'); $includeCategories = $this->model->getIncludeInArray(); if ($includeCategories) { if (!in_array($categoryId, $includeCategories)) { $landingIncluded = $currentLanding && in_array($currentLanding->getIdentifier(), $includeCategories); if (!$landingIncluded) { $exclude = true; } } } if (!$exclude) { $excludeCategories = $this->model->getExcludeFromArray(); if (in_array($categoryId, $excludeCategories)) { $exclude = true; } $landingExcluded = $currentLanding && in_array($currentLanding->getIdentifier(), $excludeCategories); if ($landingExcluded) { $exclude = true; } } if (!$exclude) { $ids = trim(str_replace(' ', '', $this->model->getDependOn())); if (!empty($ids)) { $ids = explode(',', $ids); /** @var Amasty_Shopby_Helper_Attributes $attrHelper */ $attrHelper = Mage::helper('amshopby/attributes'); $allSelectedIds = $attrHelper->getRequestedOptionIds(); if (!array_intersect($allSelectedIds, $ids)) { $exclude = true; } } } return $exclude; }
public function getIsExcluded() { if (!$this->model) { return true; } $categoryId = $this->getCurrentCategoryId(); $exclude = false; $includeCategories = $this->model->getIncludeInArray(); if ($includeCategories) { if (!in_array($categoryId, $includeCategories)) { $exclude = true; } } if (!$exclude) { $excludeCategories = $this->model->getExcludeFromArray(); if (in_array($categoryId, $excludeCategories)) { $exclude = true; } } return $exclude; }
protected function _prepareFieldsetGeneral(Amasty_Shopby_Model_Filter $model) { $fldSet = $this->_form->addFieldset('amshopby_general', array('legend' => $this->__('Display Properties'))); $yesno = array($this->__('No'), $this->__('Yes')); $isDecimal = $model->getBackendType() == 'decimal'; $fldSet->addField('block_pos', 'select', array('label' => $this->__('Show in the Block'), 'name' => 'block_pos', 'values' => Mage::getModel('amshopby/source_position')->toOptionArray())); $fldSet->addField('display_type', 'select', array('label' => $this->__('Display Type'), 'name' => 'display_type', 'values' => $model->getDisplayTypeOptionsSource()->toOptionArray())); if ($isDecimal) { $fldSet->addField('slider_type', 'select', array('label' => $this->__('Slider Type'), 'name' => 'slider_type', 'values' => Mage::getModel('amshopby/source_slider')->toOptionArray())); $fldSet->addField('slider_decimal', 'text', array('label' => $this->__('Number of digits after comma'), 'name' => 'slider_decimal')); $fldSet->addField('range', 'text', array('label' => $this->__('Range Step'), 'name' => 'range', 'note' => $this->__('Set 10 to get ranges 10-20,20-30, etc. Custom value improves pages speed. Leave empty to get default ranges.'))); $fldSet->addField('from_to_widget', 'select', array('label' => $this->__('Show From-To Widget'), 'name' => 'from_to_widget', 'values' => $yesno)); $fldSet->addField('value_label', 'text', array('label' => $this->__('Units label'), 'name' => 'value_label', 'note' => $this->__('Specify attribute units, like inch., MB, px, ft etc.'))); } else { $fldSet->addField('show_search', 'select', array('label' => $this->__('Show Search Box'), 'name' => 'show_search', 'values' => $yesno)); $fldSet->addField('max_options', 'text', array('label' => $this->__('Number of unfolded options'), 'name' => 'max_options', 'note' => $this->__('Applicable for `Labels Only`, `Images only` and `Labels and Images` display types. Zero means all options are unfolded'))); } $fldSet->addField('hide_counts', 'select', array('label' => $this->__('Hide quantities'), 'name' => 'hide_counts', 'values' => $yesno)); $fldSet->addField('sort_by', 'select', array('label' => $this->__('Sort Options By'), 'name' => 'sort_by', 'values' => array(array('value' => 0, 'label' => $this->__('Position')), array('value' => 1, 'label' => $this->__('Name')), array('value' => 2, 'label' => $this->__('Product Quatities'))))); $fldSet->addField('collapsed', 'select', array('label' => $this->__('Collapsed'), 'name' => 'collapsed', 'values' => $yesno, 'note' => $this->__('Will be collapsed until customer select any filter option'))); $fldSet->addField('comment', 'text', array('label' => $this->__('Tooltip'), 'name' => 'comment')); $this->_getDependencyMapper()->addFieldMap('display_type', 'display_type')->addFieldMap('slider_type', 'slider_type')->addFieldMap('slider_decimal', 'slider_decimal')->addFieldDependence('slider_type', 'display_type', Amasty_Shopby_Model_Catalog_Layer_Filter_Price::DT_SLIDER)->addFieldDependence('slider_decimal', 'display_type', Amasty_Shopby_Model_Catalog_Layer_Filter_Price::DT_SLIDER); }
protected function isDecimal() { return $this->model->getBackendType() == 'decimal'; }