shopware / shopware

Shopware 6 is an open commerce platform based on Symfony Framework and Vue and supported by a worldwide community and more than 1.500 community extensions
https://shopware.com
MIT License
2.79k stars 1.02k forks source link

product variable "is empty" except for non-variant product in default language #5086

Open janobi opened 1 week ago

janobi commented 1 week ago

Originally reported in issue #4070 for SW6.5.7.3, but that one timed out and this remains an issue in 6.6.5.1 as well as 6.6.6.1.

The product variable passes the 'is empty' test in Twig templates if it's a storefront domain with a non-default language or the current product is a variant product. I was able to test this in a new sales channel with the base theme.

For example, in templates like storefront/component/buy-widget/buy-widget.html.twig and storefront/component/product/card/box-standard.html.twig, product is empty (or, in the case of the product detail page, page.product is empty) evaluates to true in the mentioned conditions. This is the case despite the product data being still visibly loaded and dump()able. This ruins checks in included templates for valid passed product variables - even product|default('something') will evaluate to 'something'.

shopware-issue-bot[bot] commented 1 week ago

We found the following existing issues which may help or are related to your topic: