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
If i set a main variant in my variant listing configs, it should be preselect on the first load of a product page.
Actual behaviour
It doesn't, because there is a bug in the method checkVariantListingConfig on line 127 and 141 within the Content/Product/SalesChannel/Detail/ProductDetailRoute.php:
$productData = $this->connection->fetchAssociative( SELECT variant_listing_config as variantListingConfig, parent_id as parentId FROM product ...
This query always leeds to a return value null within the following condition on line 141:
This is because a product can have a database entry in parent_id (x)or in variant_listing_config, but never in both. So the method always return null.
How to reproduce
Try to define a specific variant as main variant in the variant listing config and you will see, that this setting will have no effect. If you request a product page with the parent url, a random variant will be choosen and displayed.
The text was updated successfully, but these errors were encountered:
PHP Version
PHP 8.3
Shopware Version
6.6.2.0
Expected behaviour
If i set a main variant in my variant listing configs, it should be preselect on the first load of a product page.
Actual behaviour
It doesn't, because there is a bug in the method checkVariantListingConfig on line 127 and 141 within the Content/Product/SalesChannel/Detail/ProductDetailRoute.php:
$productData = $this->connection->fetchAssociative( SELECT variant_listing_config as variantListingConfig, parent_id as parentId FROM product ...
This query always leeds to a return value null within the following condition on line 141:
if (empty($productData) || empty($productData['parentId']) || $productData['variantListingConfig'] === null) { return null; }
This is because a product can have a database entry in parent_id (x)or in variant_listing_config, but never in both. So the method always return null.
How to reproduce
Try to define a specific variant as main variant in the variant listing config and you will see, that this setting will have no effect. If you request a product page with the parent url, a random variant will be choosen and displayed.
The text was updated successfully, but these errors were encountered: