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
Truncate the product entity and reset the auto increment to start from 1
Reimport the products in Adobe commerce
Actual result
Undefied index exception while returning the variants collection at vendor/scandipwa/catalog-graphql/src/Model/Variant/Collection.php while accessing $childCollectionMap
Expected result
Variants should be returns for the configurable details
Reason for this issue
Adobe commerce uses row_id from product_entity for mapping the child products and its parent product, where as in the Collection class it uses entity_id to access this.
If the products are imported without resetting the auto incrementer, it works fine as the value for entity_id and row_id will be same.
Solution
We can use Magento\Framework\EntityManager\MetadataPool to fetch the row_id or entity_id depending on the Magento version where ScandiPWA is used.
NavaneethVijay
changed the title
Variants collection return null in Adobe cloud commerce due to usage of row_id for product mapping.
Variants collection returns null in Adobe cloud commerce due to usage of row_id for product mapping.
Sep 15, 2022
Steps to reproduce:
Actual result
Undefied index exception while returning the variants collection at
vendor/scandipwa/catalog-graphql/src/Model/Variant/Collection.php
while accessing$childCollectionMap
Expected result
Variants should be returns for the configurable details
Reason for this issue
Adobe commerce uses row_id from
product_entity
for mapping the child products and its parent product, where as in the Collection class it uses entity_id to access this.If the products are imported without resetting the auto incrementer, it works fine as the value for entity_id and row_id will be same.
Solution
We can use
Magento\Framework\EntityManager\MetadataPool
to fetch the row_id or entity_id depending on the Magento version where ScandiPWA is used.For example:
Instead of using
$product->getId();
This way of accessing the products will make sure Scandipwa is compatible with Magento Commerce data.
Versions
The text was updated successfully, but these errors were encountered: