davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018

I have two sales channels for different domains. And I also have 2 themes, one for each of them. It seems that when I enable the theme plugin, it starts to affect the designs even if it is not assigned to any sales channel. How to prevent that from happening ?

Answers

  • davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018

    @Moritz Naczenski‍ Do you know why the scss files are only working on corresponding sales channels, but the twig files affect both of the sales channels ?

  • Moritz NaczenskiMoritz Naczenski AdministratorsComments: 9369 Received thanks: 2822 Member since: September 2013

    Sounds like a question for the support. But normally only the assigned themes will be losded.

  • davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018

    The scss files are not loaded wrongly, just only the twig templates. Does that have something to do with the where are located the twig files? in both theme plugins they are located under the directory src/Resources/views/storefront/

  • davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018

    @Moritz Naczenski‍ do you know whom should I ask from support, is there anyone in forums?

  • Moritz NaczenskiMoritz Naczenski AdministratorsComments: 9369 Received thanks: 2822 Member since: September 2013

    Did you create the theme via shopware console?

    Or how did you create the theme?

  • davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018

    @Moritz Naczenski‍ I have created both of the themes by myself according the Shopware guide. For a single sales channel website they work as intended.

    scss files are located in src/Resources/app/storefront/src/scss

    The twig files are located under the directory src/Resources/views/storefront/(layout or block, etc.)

    Below is the theme.json file:

    {
        "name": "IluDesign Theme",
        "author": "David Sargsyan",
        "previewMedia": "storefront/dist/assets/Ilu_Design_logo.png",
        "style": [
          "app/storefront/src/scss/overrides.scss",
          "@Storefront",
          "app/storefront/src/scss/base.scss"
        ],
        "views": [
          "@Storefront",
          "@Plugins",
          "@DasIluDesignTheme"
        ],
        "script": [
            "@Storefront",
            "app/storefront/dist/storefront/js/navigation.js"
        ],
        "config": {
          "fields": {
            "sw-color-brand-primary": {
              "value": "#a9a9a9"
            }
          }
        },
        "asset": [
            "app/storefront/src/assets"
        ]
    }
    

     

  • davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018

    @Moritz Naczenski‍ is the directory where the twig files are located correct?
    In here https://docs.shopware.com/en/shopware-platform-dev-en/theme-guide/twig-templates?category=shopware-platform-dev-en/theme-guide in some places it is sometimes mentioned that twig files should be under src/Resources/app/storefront/views/(layout or something else)/ and in some other places it is under /Resources/views/storefront/layout/header.

    Which one is correct? Is the problem in directory structure or that I have not generated the plugin by shopware cli console ?

  • Moritz NaczenskiMoritz Naczenski AdministratorsComments: 9369 Received thanks: 2822 Member since: September 2013

    Show us your Bootstrap, it needs to implement ThemeInterface

     

    <?php declare(strict_types=1);
    
    namespace themename;
    
    use Shopware\Core\Framework\Plugin;
    use Shopware\Storefront\Framework\ThemeInterface;
    
    class themename extends Plugin implements ThemeInterface
    {
        public function getThemeConfigPath(): string
        {
            return 'theme.json';
        }
    }

    otherwhise it is a plugin and will be loaded in every sales-channel, not only the assigned one.

  • davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018
    <?php declare(strict_types=1);
    
    namespace Das\IluDesignTheme;
    
    use Shopware\Core\Framework\Plugin;
    use Shopware\Storefront\Framework\ThemeInterface;
    
    class DasIluDesignTheme extends Plugin implements ThemeInterface
    {
        public function getThemeConfigPath(): string
        {
            return 'theme.json';
        }
    }
    

    It does, and the theme appears, I select the theme, but when I do so, the changes to the template, start to affect the other sales channel as well.

  • davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018

    @Moritz Naczenski‍ the only difference I see here is the namespace, after the prefix I write a backslash \.

  • davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018

    @Moritz Naczenski‍ And yes it seems that the twig files behave as if they are in just a regular plugin, but I am not seeing the reason.

  • davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018

    @Moritz Naczenski‍ is everything correct?

  • davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018

    @Moritz Naczenski‍ we also opened a ticket but neither here nor there in account support we see an answer to this problem.

  • Moritz NaczenskiMoritz Naczenski AdministratorsComments: 9369 Received thanks: 2822 Member since: September 2013

    I can't support you any more on this topic, since I don't know where your issue comes from. For me, everything looks fine.

    This forum is based ony the idea "users helping users", so we can't provide you any official support in this forum. If you created an official support request, you will get an anwer based on your subscription. 

     

  • davit_sargsyandavit_sargsyan MemberComments: 71 Received thanks: 0 Member since: June 2018

    @Moritz Naczenski‍ we have got a response from the support, so others who may be interested as well, this is a known issue and will be fixed in 6.2

    https://issues.shopware.com/issues/NEXT-7269

Sign In or Register to comment.