简体   繁体   English

Magento - 分层导航,可配置产品,多个过滤器活动问题

[英]Magento - Layered navigation, configurable products, multiple filters active issue

Say I have a single configurable product in a Magento (1.7) store, "T-Shirt-A" which comes in Red (sizes 1,2) and Black (size 2). 假设我在Magento(1.7)商店中有一个可配置产品,“T-Shirt-A”有红色(尺寸1,2)和黑色(尺寸2)。

In the layered navigation if I select "Black" and "size 1" 在分层导航中,如果我选择“黑色”和“大小1”

  • I WANT to see no results - because there are no simple products that are available in "Black" AND "size 1". 我希望看不到任何结果 - 因为没有简单的产品可用“黑色”和“尺寸1”。
  • INSTEAD I SEE "T-Shirt-A" because it comes in Black and in Size 1 (but, no associated simple product meets both criteria) INSTEAD我看到“T恤-A”因为它有黑色和尺寸1(但是,没有相关的简单产品符合这两个标准)

What can I do to achieve the search results I want (have the filters show the configurable products which have at least one associated simple product that meets ALL filtered criteria). 我可以做些什么来实现我想要的搜索结果(让过滤器显示可配置的产品,这些产品至少有一个符合所有过滤标准的关联简单产品)。

All EAV dropdown-attribute values used for layered navigation are stored in the catalog_product_index_eav table, which only knows about one single product at a time. 用于分层导航的所有EAV下拉列表属性值都存储在catalog_product_index_eav表中,该表一次只能catalog_product_index_eav一个产品。 Configurable products may have multiple values for each attribute depending on their children, but then the original belongings of those values are lost, which leads to the case you get. 可配置产品可能具有多个值,每个属性取决于他们的孩子,但随后这些值的原始所有物丢失,这导致您得到的情况。

To make it work like you want, you would have to rework the way EAV values are indexed for configurable products and layered navigation ( Mage_CatalogIndex_Model_Indexer_Eav ), and the way they are retrieved and used for filtering ( Mage_Catalog_Model_Layer_Filter_Attribute ) 为了使它按照您的意愿工作,您必须重新Mage_CatalogIndex_Model_Indexer_Eav EAV值为可配置产品和分层导航( Mage_CatalogIndex_Model_Indexer_Eav )编制索引的方式,以及检索它们并用于过滤的方式( Mage_Catalog_Model_Layer_Filter_Attribute

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

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