Reputation: 11
I have copied magento-frontend-luma theme and change vendor\theme name and paste in design folder magento2\app\design\frontend\Webmyne\pruthvi
In registration.php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/Webmyne/pruthvi',
__DIR__
);
In theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Webmyne Pruthvi</title>
<parent>Magento/blank</parent>
<media>
<preview_image>media/preview.jpg</preview_image>
</media>
</theme>
In composer.json
{
"name": "webmyne/pruthvi",
"description": "N/A",
"require": {
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
"magento/theme-frontend-blank": "100.2.*",
"magento/framework": "101.0.*"
},
"type": "magento2-theme",
"version": "100.2.3",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
]
}
}
But when I try to change theme from CONTENT > Design > Configuration
I am getting the error 'Area is already set'
Upvotes: 0
Views: 1171
Reputation: 167
This is a re-owned issue of Magento 2.2.4 C.E.
Magento has been fixed by Daniel Ruf at https://github.com/magento/magento2/commit/7019a0a1392095185505ff3ca7b97dd3e9cb4ef2 at PR #15137 and already merge at 2.2-develop branch
You need to modify the code of setForcedArea method and Replace that method code using below one.
public function setForcedArea($templateId)
{
if (!isset($this->area)) {
$this->area = $this->emailConfig->getTemplateArea($templateId);
}
return $this;
}
Reference:
Upvotes: 0
Reputation: 2988
I think the problem is in your registration.php
file
try changing it this way
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'Webmyne_pruthvi',
__DIR__
);
so deleting the frontend
part in the declaration. There is no need to specify the area if you're inheriting from a theme that has already declared is for the frontend area.
Upvotes: 0