简体   繁体   English

Magento:如何通过另一个类别过滤当前类别-分层导航

[英]Magento: How to filter current category by another category - layered navigation

I have a Magento (1.7.0.2) installation with some products inside. 我有一个内部装有某些产品的Magento(1.7.0.2)安装。 I have two sibling categories (Brand and Clothes). 我有两个同级(品牌和服装)。 Brand contains all the brands of the clothes, and clothes have multiple subcategories (shoes, pants, etc.) I am using layered navigation. 品牌包含衣服的所有品牌,并且衣服具有多个子类别(鞋子,裤子等),我正在使用分层导航。 When opening a category (lets say "shoes"), I display a list of the brands in the layered navigatin (I wrote some custom code for this). 打开类别(例如说“鞋子”)时,我在分层的navigatin中显示品牌列表(为此我编写了一些自定义代码)。

Here is the problem: When I click on a brand, I want magento to filter the products by both categories and display matching results. 这是问题所在:单击品牌时,我希望magento按两个类别过滤产品并显示匹配的结果。 Since Magento's default functionality is to just display items from the last category clicked, I need to change this. 由于Magento的默认功能是仅显示最后单击的类别中的项目,因此我需要对此进行更改。

Does anyone have any ideas how ? 有谁知道如何?

You need to define attributes for that and you don't need to write custom code for that at all. 您需要为此定义属性,而根本不需要编写自定义代码。 So it would work for you like double structure there where you add a actual matching attribute and a shadow category for that matching attribute. 因此,它像您在其中添加实际匹配属性和该匹配属性的阴影类别的双重结构一样对您有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM