You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the same child product is associated to multiple bundle products, only one of the bundle products is saved in ES. This causes bundle products to not appear in categories / search if they share the same child product.
Believe the query result should be grouped by parent_product_id as well?
Query before:
SELECT parent.entity_id AS parent_id, child.entity_id AS child_id, GROUP_CONCAT(DISTINCT super_table.attribute_id SEPARATOR ',') AS configurable_attributes FROM catalog_product_bundle_selection AS main
INNER JOIN catalog_product_entity AS parent ON parent.entity_id = main.parent_product_id
INNER JOIN catalog_product_entity AS child ON child.entity_id = main.product_id
LEFT JOIN catalog_product_super_attribute AS super_table ON super_table.product_id = main.parent_product_id
INNER JOIN catalog_product_website AS websites ON websites.product_id = main.product_id AND websites.website_id = '1'
WHERE (parent.entity_id in (2399, 1534)) GROUP BY main.product_id
SELECT parent.entity_id AS parent_id, child.entity_id AS child_id, GROUP_CONCAT(DISTINCT super_table.attribute_id SEPARATOR ',') AS configurable_attributes FROM catalog_product_bundle_selection AS main
INNER JOIN catalog_product_entity AS parent ON parent.entity_id = main.parent_product_id
INNER JOIN catalog_product_entity AS child ON child.entity_id = main.product_id
LEFT JOIN catalog_product_super_attribute AS super_table ON super_table.product_id = main.parent_product_id
INNER JOIN catalog_product_website AS websites ON websites.product_id = main.product_id AND websites.website_id = '1'
WHERE (parent.entity_id in (2399, 1534)) GROUP BY main.parent_product_id, main.product_id
I'll be submitting a pull request with this fix implemented in a few minutes. However, I'm not sure if this affects configurable products in some way (got no products with "configurable_attributes" filled to test with).
The text was updated successfully, but these errors were encountered:
When the same child product is associated to multiple bundle products, only one of the bundle products is saved in ES. This causes bundle products to not appear in categories / search if they share the same child product.
Preconditions
Not relevant
Magento Version : Magento 2.2.1
ElasticSuite Version : 2.4.x-dev @ 55becb9
Environment : Either
Third party modules : Not relevant
Steps to reproduce
Expected result
Actual result
The actual cause for this is in https://github.com/Smile-SA/elasticsuite/blob/2.4.x/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php#L208 - the "group by" statement groups query by child products, meaning if one child product is assigned to multiple bundle products, all except the first connection are lost (group concat affects only "configurable_attributes" field.
Believe the query result should be grouped by parent_product_id as well?
Query before:
Result: http://prntscr.com/hh0ewj
Query after:
Result after: http://prntscr.com/hh0fcs
I'll be submitting a pull request with this fix implemented in a few minutes. However, I'm not sure if this affects configurable products in some way (got no products with "configurable_attributes" filled to test with).
The text was updated successfully, but these errors were encountered: