Remove text from template?

I want to remove the text " Prices inc. VAT plus shipping cost" from the product detail page. Found the block in two different templates:

  • storefront > page > product-detail > buy-widget.html.twig
  • storefront > component > but-widget > buy-widget.html.twig

Have tried to override both templates (with {% sw_extends '@Storefront/storefront/ …) but nothing seems to be working? Have cleared the cache after each changes.

What am I missing?

/ Magnus

twig templates can only be overwritten once. Do you have any plugins installed, overwriting these templates, too?

Active the dev modus and use synfony debugging in the frontend. There you can see how twig renders the templates.

Hi @Max_Shop
I have only overrided the templates once (I think!). To check if I’m using the correct template, I added a new class („test“) to the div - but it does not show up when checking with the browser inspection tool. So something is not correct…

No other extension installed.

I have the Symfony bar in the bottom, but are not sure how to see which template is used (I can see the route). Do I need to activate dev mode in another way?

Well, I took the easy way out, and set the visibility: hidden in the CSS. :slightly_smiling_face:

When you can see the Synfony bar on the bottom its the second from the right. Its called Twig Metrics.

There you can search for you template file. Then you see the order and how often it got overwritten.

1 Like