1

Can I use the same theme ( Hiddentechie's Bizkick ) for two stores ( on one Magento 2 installation )?

What is the simplest approach for this setup?

On this Magento 2 installation,

  1. one db,
  2. several category tree for different stores
  3. one copy of Hiddentechie Bizkick theme inside app/design/frontend
  4. have set MAGE_RUN_CODE for different stores
  5. have created some blocks with different visibility on stores, so different store will not show the same set of blocks (if existed).

But there are some issues:

  1. some footer columns are not content blocks defined, hardcoded in phtml
  2. the languages of the stores are not the same
  3. some basic business information e.g. phone, address, name are different for stores

I once tried to create a child theme for Hiddentechie Bizkick (as parent), when I compile it warned 'circular dependencies' on parent theme because i define hiddentechie bizkick as parent while bizkick define magento luma/blank as parent. i don't know whether this is the circular dependencies mentioned, anyway, the compile process failed and killed in this case.

1 Answer 1

0

Yes, you can use the same for two stores on one Magento 2 installation, but almost cases we have to create 2 themes that base on a parent theme, which will resolve the issues you mentioned in your post.

Notice: whenever you use a 3rd-party theme, you should create a child theme base on that theme to make it upgrade easier in the future.

Now, let's create 2 new child themes based on Hiddentechie Bizkick theme. Assume you named your 2 new child themes are: Dennis/Clothing and Dennis/Sport.

Following the below steps to create Dennis/Clothing theme:

  1. Create a directory for the theme: app/design/frontend/Dennis/Clothing.
  2. Add a declaration file theme.xml: app/design/frontend/Dennis/Clothing/theme.xml.
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Dennis Clothing</title>
    <parent>Hiddentechies/bizkick</parent>
</theme>

  1. Add registration.php: app/design/frontend/Dennis/Clothing/registration.php.
<?php

use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Dennis/Clothing', __DIR__);

Following the below steps to create Dennis/Sport theme:

  1. Create a directory for the theme: app/design/frontend/Dennis/Sport.
  2. Add a declaration file theme.xml: app/design/frontend/Dennis/Sport/theme.xml.
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Dennis Sport</title>
    <parent>Hiddentechies/bizkick</parent>
</theme>

  1. Add registration.php: app/design/frontend/Dennis/Sport/registration.php.
<?php

use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Dennis/Sport', __DIR__);

You're done creating 2 child themes, to apply these theme to your store:

  1. Open the Admin, go to Content > Design > Configuration. A Design Configuration page opens. It contains a grid with the available configuration scopes.
  2. In the configuration record corresponding to your store view, click Edit. The page with design configuration for the selected scope opens.
  3. On the Default Theme tab, in the Applied Theme drop-down, select your newly created theme. Click Save Configuration.

After applying these 2 themes to your 2 stores, clear cache. You are done!

5
  • If this answer works as your expected, please mark it as accepted, it makes it easier for others with the same issue to find a verified answer. And that would be great if you click the upvote button in case you feel the answer is useful.
    – Tu Van
    Oct 22, 2022 at 18:54
  • thanks, your answer is correct. Oct 23, 2022 at 14:46
  • there is one thing i can share with you guys is i made misunderstanding on child theme, child theme cannot locate below the vendor theme dir of parent. this is the reason for 'circular dependencies' mentioned before. i created my own vendor dir instead of using the parent Hiddentechie dir, the error disappeared. compile successful. Oct 23, 2022 at 14:48
  • sorry my reputation not high enough for upvote. Oct 23, 2022 at 14:49
  • No worries. I'm glad to help you.
    – Tu Van
    Oct 23, 2022 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.