0

I purchased a theme for a Magento 2 website. I know want to create a child theme to modify some of the styles, etc.

The theme purchased is called Porto and resides in

/app/design/frontend/Smartwave/porto 

So I created a directory

/app/design/frontend/Smartwave/porto_child

I then created a theme.xml file with the below contents

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Proto Child</title> <!-- your theme's name -->
    <parent>Smartwave/porto</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
    <media>
        <preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
    </media>
</theme>

I then created a registration.php file

  <?php
      /**
        * Copyright © 2015 Magento. All rights reserved.
        * See COPYING.txt for license details.
        */
       \Magento\Framework\Component\ComponentRegistrar::register(
          \Magento\Framework\Component\ComponentRegistrar::THEME,
          'frontend/Smartwave/porto_child',
          __DIR__
        );

I also created a directory called media and put a preview.jpg in there now when I go to the admin panel I get an error when I view the log in the var/report folder I see an error that says

 a:4:{i:0;s:107:"File '/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists."

When I SFTP to the directory I see the file!

When I run (on the command line)

mage setup:upgrade

I get a message that says

[Exception] File'/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists.

Also When i run sudo bin/magento setup:static-content:deploy -t Smartwave/porto_child

[InvalidArgumentException] Smartwave/porto_child argument has invalid value, available themes are: Magento/blank, Magento/luma, Magento/backend, Smartwave/porto_rtl, Smartwave/porto
2
  • Check if you're theme and porto wasn't registered as virtual theme. In MySQL table theme it should be of type 0 (psychical) and not 1 (virtual). There were various issues with themes because of it. magento.stackexchange.com/questions/92181/… Commented Apr 17, 2017 at 20:33
  • when I look in mysql in the theme table I see the parent theme is listed and is type zero. but the child theme is not listed.
    – Jayreis
    Commented Apr 17, 2017 at 20:47

1 Answer 1

0

Check if the path really exist and run these commands below to give permit to folders and do a deploy, if have some problem will show up with the description:

alias mage="php -d memory_limit=-1 -f bin/magento"

chmod -R 775 pub/static/ var/ pub/media/ &&
rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/ ;
mage cache:clean &
mage cache:flush &
mage indexer:reindex &
mage setup:upgrade &&
mage setup:static-content:deploy -t Smartwave/porto_child
mage setup:db-data:upgrade &&
mage dev:source-theme:deploy &&
chmod -R 775 pub/static/ pub/media/ var/

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.