문제

In few words - problem is same as in this question Magento - Layered navigation, configurable products, multiple filters active issue

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.

The reason of that is that in index table catalog_product_index_eav it would have something like:

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

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.

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

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. Really it looks like it must work not only with grouped...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top