本文整理汇总了PHP中Mage_Catalog_Block_Layer_Filter_Abstract类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Block_Layer_Filter_Abstract类的具体用法?PHP Mage_Catalog_Block_Layer_Filter_Abstract怎么用?PHP Mage_Catalog_Block_Layer_Filter_Abstract使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Catalog_Block_Layer_Filter_Abstract类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: init
/**
* 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();
}
开发者ID:VizualAbstract,项目名称:multiple-select-nav,代码行数:14,代码来源:Filter.php
示例2: _prepareFilter
/**
* 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();
}
开发者ID:bitbull-team,项目名称:magento-module-category-layered,代码行数:15,代码来源:CategoryLayered.php
示例3: init
/**
* 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;
}
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:19,代码来源:Abstract.php
示例4: init
/**
* 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();
}
开发者ID:rubenjohne,项目名称:ts-echo,代码行数:12,代码来源:Filter.php
示例5: displayFilter
/**
* 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;
}
开发者ID:atlanticbt,项目名称:atlanticbt_layerednavigation,代码行数:42,代码来源:Data.php
示例6: prepare
public function prepare()
{
$this->filter->setTemplate($this->setTemplate());
$this->filter->setCollapsed($this->setCollapsed());
$this->filter->setHasSelection($this->setHasSelection());
$this->filter->setPosition($this->setPosition());
}
开发者ID:victorkho,项目名称:telor,代码行数:7,代码来源:Abstract.php
示例7: getItemsAsArray
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;
}
开发者ID:xiaoguizhidao,项目名称:tyler-live,代码行数:32,代码来源:Stock.php
示例8: __construct
/**
* 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');
}
开发者ID:diglin,项目名称:smile-magento-elasticsearch,代码行数:12,代码来源:Attribute.php
示例9: __construct
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');
}
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:10,代码来源:Links.php
示例10: prepare
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());
}
开发者ID:rcclaudrey,项目名称:dev,代码行数:8,代码来源:Abstract.php
示例11: getItemsCount
/**
* 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;
}
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:19,代码来源:Attribute.php
示例12: getItems
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();
}
开发者ID:vstorm83,项目名称:ausport,代码行数:15,代码来源:Stock.php
示例13: _construct
protected function _construct()
{
parent::_construct();
$this->_filterModelName = 'Mage_Catalog_Model_Layer_Filter_Attribute';
}
开发者ID:natxetee,项目名称:magento2,代码行数:5,代码来源:Attribute.php
示例14: __construct
/**
* Initialize Textfield filter module
*
*/
public function __construct()
{
parent::__construct();
$this->_filterModelName = 'catalog/layer_filter_textfield';
}
开发者ID:CherylMuniz,项目名称:fashion,代码行数:9,代码来源:Textfield.php
示例15: __construct
/**
* 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';
}
开发者ID:javik223,项目名称:Evron-Magento,代码行数:10,代码来源:Attribute.php
示例16: __construct
/**
* overide filter model name.
*/
public function __construct()
{
parent::__construct();
$this->_filterModelName = 'elasticgento/catalog_layer_filter_category';
}
开发者ID:Mohitsahu123,项目名称:Elasticgento,代码行数:8,代码来源:Category.php
示例17: __construct
/**
* Initialize Price filter module
*
*/
public function __construct()
{
parent::__construct();
$this->_filterModelName = 'Mage_Catalog_Model_Layer_Filter_Price';
}
开发者ID:relue,项目名称:magento2,代码行数:9,代码来源:Price.php
示例18: __construct
/**
* 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';
}
开发者ID:javik223,项目名称:Evron-Magento,代码行数:10,代码来源:Decimal.php
示例19: __construct
public function __construct()
{
parent::__construct();
$this->_filterModelName = 'inchoo_sale/catalog_layer_filter_sale';
}
开发者ID:Gobbob,项目名称:Inchoo_Sale,代码行数:5,代码来源:Sale.php
示例20: __construct
public function __construct()
{
parent::__construct();
$this->_filterModelName = 'holoflek_filters/layer_filter_category';
$this->setTemplate('holoflek/filters/layer/categoryfilter.phtml');
}
开发者ID:ayaroshevskiy,项目名称:portfolio-magento-hfilters,代码行数:6,代码来源:Category.php
注:本文中的Mage_Catalog_Block_Layer_Filter_Abstract类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论