简体   繁体   English

Magento分组产品的分层导航过滤器

[英]Magento Layered navigation filters for grouped products

In few words - problem is same as in this question Magento - Layered navigation, configurable products, multiple filters active issue 简而言之-问题与该问题相同Magento-分层导航,可配置产品,多个过滤器有效问题

We have products (configutable / grouped / bundle), that have there linked simple products. 我们有产品(可配置/分组/捆绑),其中有链接的简单产品。 That linked products have own attributes, and configurable have its own. 链接的产品具有自己的属性,可配置的也有自己的属性。

Layered Navigation gets all availiable options for linked products and add them into parent product, so when we getting different combinations of filters, we can set options for non existing simple products 分层导航可获取链接产品的所有可用选项并将其添加到父产品中,因此当我们获得不同的过滤器组合时,我们可以为不存在的简单产品设置选项

Example: 例:

SKU | Type    | Country | City           | Linked Skus
--------------------------------------------------------
SP1 | Simple  | USA     | NY             | -
SP2 | Simple  | USA     | LA             | -
SP3 | Simple  | Russia  | Moscow         | -
SP4 | Simple  | Russia  | St. Pitersburg | -
GP1 | Grouped | -       | -              | SP1, SP2
GP2 | Grouped | -       | -              | SP1, SP3, SP4

In that way we can check in filters Country = USA AND City = Moscow and magento will show us product GP2 as availiable for this combination of filters. 这样,我们可以签入过滤器,国家/地区=美国和城市=莫斯科,并且magento将向我们显示产品GP2可用于此过滤器组合。

The reason of that is that in index table catalog_product_index_eav it would have something like: 原因是在索引表catalog_product_index_eav中它将具有以下内容

SKU | Attribute | Value
--------------------------------
GP1 | Country   | USA
GP1 | City      | NY
GP1 | City      | LA
GP2 | Country   | USA
GP2 | Country   | Russia
GP2 | City      | NY
GP2 | City      | Moscow
GP2 | City      | St. Pitersburg

So for this selection USA + Moscow it would show result product GP2 because it have linked simples, that have values in attributes for USA and Moscow, but really not one simple have selected USA + Moscow at same time, so showing GP2 for such filters is mistake 因此,对于此选择USA + Moscow,它将显示结果乘积GP2,因为它已链接了简单变量,具有美国和莫斯科的属性值,但实际上没有一个简单的变量同时选择USA + Moscow,因此为此类过滤器显示GP2是错误

Is there any extentions / ideas how to solve this? 有什么解决方案/想法如何解决?

Only one idea that comes to me is to add into catalog_product_index_eav additional column linked_id and for simples put into it zero value or simple entity_id value, but for grouped / configurable etc. generate index based for every linked simple + parent attribute values. 我想到的一个主意是在catalog_product_index_eav中添加附加列linked_id,并为其中的简单变量添加零值或简单的entity_id值,但对于分组/可配置等,为每个链接的简单+父属性值生成索引。

On this example it would look like: 在此示例中,它看起来像:

SKU | Attribute | Linked Sku | Value
----------------------------------------
GP1 | Country   | SP1        | USA
GP1 | Country   | SP2        | USA
GP1 | City      | SP1        | NY
GP1 | City      | SP2        | LA
GP2 | Country   | SP1        | USA
GP2 | Country   | SP3        | Russia
GP2 | Country   | SP4        | Russia
GP2 | City      | SP1        | NY
GP2 | City      | SP3        | Moscow
GP2 | City      | SP4        | St. Pitersburg

So here we can add additional condition that all attributes in row must have same Linked Sku 因此,我们可以在此处添加其他条件,即行中的所有属性必须具有相同的链接Sku

May be someone knows ready solutions for this or have any additional ideas? 可能有人知道为此准备好的解决方案,或者还有其他想法? Maybe wanna to discuss this? 也许想讨论这个?

Every ideas / solutions / opinions are welcome :) 欢迎任何想法/解决方案/意见:)

Looks like it works in such way I discribed Just developed extention that doing this.. Now we testing it, but we will test only on grouped products, because we not using other types. 看起来它以这种方式工作,我将其描述为Just发达的扩展来做到这一点。。现在我们对其进行测试,但是我们将仅对分组产品进行测试,因为我们没有使用其他类型。 Really it looks like it must work not only with grouped... 确实看起来它不仅必须与分组一起工作...

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

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