0
votes

Hello for some reason shopware is not using my custom theme. I followed the official example and ended up with the following path:

E:\XAMPP\htdocs\sw\custom\plugins\MyPlugin\src\Resources\views\storefront\layout\header\logo.html.twig

Unfortanetely, when now tying to compile the theme using

theme:compile
plugin:update MyPlugin
cache:clear

There is no visible change on the website. I made sure that the Storefront and the Headless sales channel are using my theme. Trough:

theme:change 

and the just went trough the dialogue two times.

The code inside the template is as follows:

{% sw_extends '@Storefront/storefront/layout/header/logo.html.twig' %}

{% block layout_header_logo_link %}
    <h2>Hello world!</h2>
{% endblock %}

Any help is greatly appreciated!

Thank you very much in advance.

2

2 Answers

1
votes

The problem was that the tool which autogenerates the plugin and theme dummy code, messes up the plugin name in the theme.json file, resulting in literally no behaviour.

Therefore, make sure that

"views": [
     "@Storefront",
     "@Plugins",
     "@myPlugin"
  ],

is changed to

"views": [
         "@Storefront",
         "@Plugins",
         "@MyPlugin"
      ],

Notice the change on the last line, make sure that the name matches your plugin name and then you are good to go.

0
votes

Sometimes it is cache related so delete cache in settings or run command psh.phar cache in project root, u could also use command bin/console cache:clear