Which twig template to extend for a custom theme?

I run Shopware 6 locally and using the development template. I needed to remove the product number from the product detail page. So, I override the twig template „buy-widget.html.twig“:

{% sw_extends '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}

{% block page_product_detail_ordernumber_container %}
        
{% endblock %}

Works as expected - if I have not change the layout template for the product, but using the Shopware default.

If I change the layout to a custom layout (like a plain copy of the default layout) the product number is back?! :thinking:

Checking with the Symfony Profiler, I can see that it’s now another twig template (from a folder „component/…“ responsible for displaying the product number.

Question: Am I correct to assume that I should extend the twig template from this component folder if I’m using a custom layout? I have not find anything in the docs about these „small“ details. And if one need to be sure that a custom theme works in every case, you must make the changes (using sw_extends) in two files?

/Magnus

YMMD… you could spend hours on that issue.

It is not about the template, it is about page or component.

Shopware uses for static pages, e.g. search results the page folder. For template pages (designer) the component folder, e.g. the listing or detail page.

Thus you have to change both files.

:smile:
Thanks @Max_Shop . That was what I was afraid of.
So, best to keep one eye on the Symfony Profiler.