Magento中产品属性筛选器 Use In Layered Navigation 说明 边栏调用 configurableswatches

7天成为Magento系统架构师,现在开始学习Magento全栈开发!

《Magento2.X企业级开发实战》

在Magento中,提供了使用商品属性对产品进行筛选的功能,在分类页的侧栏中显示,如果没有设定好要进行筛选的属性,那么默认只显示 使用子分类进行产品筛选。筛选器的默认标题是 shop by
上图中的color属性是重新添加的,price属性是默认就开启的,但是全新安装的magento,加入产品后,并不会显示这个属性筛选,我们需要对属性进行设置才可以。 在后台选择属性管理
在 过滤器中搜索 price,并选择 price属性,
在 打开的属性修改页面,更改 Use In Layered Navigation属性
该属性有三个选项,
No: 该属性不作为筛选属性。
Filterable (with results) 作为筛选属性,只显示有结果的筛选项
Filterable (no results) 作为筛选属性,显示所有的筛选项,包括没有产品数量的筛选项。
设置,保存,更新index和缓存。
在分类页面上刷新,我们看到依然没有 price的属性筛选框,我们还有另外一个地方需要设置。
在产品分类的显示设置中 有一个 Is anchor (n.锚 v.抛锚,停泊;(使)固定)的选项设置,把该选项设为yes,保存,在查看一下,price筛选器就显示出来了。
,其他的属性,也是一样的设置方式,比如说,我们要对产品增加一个品牌的属性筛选,这个属性在默认的属性中并不存在,那么我们就要使用属性管理,新建一个属性,然后在把它设置成筛选属性。
参考

//Magento 1.9x 自带的 模板
appdesignfrontendrwddefaulttemplateconfigurableswatchescataloglayerfilter/swatches.phtml
getInnerWidth(Mage_ConfigurableSwatches_Helper_Swatchdimensions::AREA_LAYER);
$_swatchInnerHeight = $_dimHelper->getInnerHeight(Mage_ConfigurableSwatches_Helper_Swatchdimensions::AREA_LAYER);
$_swatchOuterWidth = $_dimHelper->getOuterWidth(Mage_ConfigurableSwatches_Helper_Swatchdimensions::AREA_LAYER);
$_swatchOuterHeight = $_dimHelper->getOuterHeight(Mage_ConfigurableSwatches_Helper_Swatchdimensions::AREA_LAYER);
?>


    getItems() as $_item): ?> getCount() > 0); $_label = $_item->getLabel(); $_swatchUrl = Mage::helper('configurableswatches/productimg')->getGlobalSwatchUrl($_item, $_label, $_swatchInnerWidth, $_swatchInnerHeight); $_hasImage = (!empty($_swatchUrl)); $_linkClass = 'swatch-link' . (($_hasImage) ? ' has-image' : ''); $_linkCss = 'height:' . $_swatchOuterHeight . 'px; ' . ((!$_hasImage) ? 'min-' : '') . 'width:' . $_swatchOuterWidth . 'px;'; $_lineHeight = $_swatchOuterHeight + 2; ?>
  1. > > <?php echo $_label; ?> shouldDisplayProductCount()): ?> (getCount() ?>)

appdesignfrontendrwddefaultlayout/configurableswatches.xml

skin_jsjs/configurableswatches/product-media.jsskin_jsjs/configurableswatches/swatches-list.jsskin_jsjs/configurableswatches/product-media.jsskin_jsjs/configurableswatches/swatches-product.jsconfigurableswatches/productimgfilterImageInGallery

转载请注明:(●–●) Hello.My Weicot » Magento中产品属性筛选器 Use In Layered Navigation 说明 边栏调用 configurableswatches

文章来源于互联网:Magento中产品属性筛选器 Use In Layered Navigation 说明 边栏调用 configurableswatches

如无特殊说明或标注,任何个人或组织,复制、转载、采集本站内容请注明:
本文来源于:【Magento中文网】,并添加本文地址链接。
如未按上述操作复制或转载,本站有权追究法律责任。
若本站内容侵犯了原著者的合法权益,可联系我们进行处理。