本文介绍了Magento-分层导航,可配置产品,多个过滤器有效问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我在Magento(1.7)商店中有一个可配置的产品,"T-Shirt-A"有红色(1,2号)和黑色(2号).

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).

在分层导航中,如果我选择黑色"和尺寸1"

In the layered navigation if I select "Black" and "size 1"

  • 我希望没有结果-因为没有简单的产品可以使用黑色"和尺寸1".
  • 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).

推荐答案

用于分层导航的所有EAV下拉属性值都存储在catalog_product_index_eav表中,该表一次只知道一个产品.可配置产品可能会根据其子级而为每个属性具有多个值,但是这些值的原始所有物都会丢失,从而导致出现这种情况.

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. 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.

要使其按需工作,必须重新设计为可配置产品和分层导航(Mage_CatalogIndex_Model_Indexer_Eav)索引EAV值的方式,以及检索和用于过滤(Mage_Catalog_Model_Layer_Filter_Attribute)的方式

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)

这篇关于Magento-分层导航,可配置产品,多个过滤器有效问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 10:18