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
{{ message }}
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
Problem position attribute for Grouped Products is always 0 for all linked products. I.e. the order/position of the products that make up the grouped product are not mirrored in Elasticsearch.
Root cause
In magento2-vsbridge-indexer/src/module-vsbridge-indexer-catalog/Model/ResourceModel/Product/Links.php the function fetchPositionAttributeData() returns a single row from db (first row in result set). The problem is that the where clause used here actually returns multiple rows, ie the position attribute for all link types.
We would need to add the link_type_id to the where clause to get the correct product_link_attribute_id to use in the join.
I'm not sure exactly how to handle this one myself or if maybe there is a better/simpler solution than the one I proposed. the problem I see is that we actually don't have the link_type yet since we are still building the query when fetchPositionAttributeData() is called if I interpret the code correctly.
The text was updated successfully, but these errors were encountered:
Problem
position
attribute for Grouped Products is always0
for all linked products. I.e. the order/position of the products that make up the grouped product are not mirrored in Elasticsearch.Root cause
In
magento2-vsbridge-indexer/src/module-vsbridge-indexer-catalog/Model/ResourceModel/Product/Links.php
the functionfetchPositionAttributeData()
returns a single row from db (first row in result set). The problem is that the where clause used here actually returns multiple rows, ie the position attribute for all link types.We would need to add the
link_type_id
to the where clause to get the correctproduct_link_attribute_id
to use in the join.Solution
Add
link_type = [current link type]
to the where clause herehttps://github.com/DivanteLtd/magento2-vsbridge-indexer/blob/3565158727d421013419cc45904a0e00f756a124/src/module-vsbridge-indexer-catalog/Model/ResourceModel/Product/Links.php#L222
I'm not sure exactly how to handle this one myself or if maybe there is a better/simpler solution than the one I proposed. the problem I see is that we actually don't have the
link_type
yet since we are still building the query whenfetchPositionAttributeData()
is called if I interpret the code correctly.The text was updated successfully, but these errors were encountered: