Assuming you've setup Magento's admin area to use comapnyname
, as per Ben's answer, if you're still running into trouble, I'd jump right to the source.
The Mage_Core_Model_Design_Package
class is where Magento decides which files to use for a theme. First the current theme is checked. If nothing's found there, then the default
theme is checked. That check happens here
#File: app/code/core/Mage/Core/Model/Design/Package.php
public function validateFile($file, array $params)
{
$fileName = $this->_renderFilename($file, $params);
$testFile = (empty($params['_relative']) ? '' : Mage::getBaseDir('design') . DS) . $fileName;
if (!file_exists($testFile)) {
return false;
}
return $fileName;
}
I'd temporarily add some poor man's logging to this function to see the file's Magento is actually accepting or rejecting during a request.
#File: app/code/core/Mage/Core/Model/Design/Package.php
public function validateFile($file, array $params)
{
$fileName = $this->_renderFilename($file, $params);
$testFile = (empty($params['_relative']) ? '' : Mage::getBaseDir('design') . DS) . $fileName;
if (!file_exists($testFile)) {
file_put_contents('/tmp/design-files.log',"REJECT: $testFile\n",FILE_APPEND);
return false;
}
file_put_contents('/tmp/design-files.log',"ACCEPT: $testFile\n",FILE_APPEND);
return $fileName;
}
My guess is you've got a subtle, hard to spot typo in one of your file paths. Try
ls -l [filename]
with the results from the above logging.
Update: Based on the comments you've made, it sounds like you're working with a system where someone has customized things to work differently, and the behavior is a side effect on that.
The two tacts I'd take on debugging this are
Figure out how your system sets the value for customtheme
, and why this code isn't called when the page renders the Custom Options section
The custom options are rendered via ajax. Normally, this is with a URL that looks like the following
http://magento.example.com/index.php/admin/catalog_product/options/id/166/key/2d18a7efe76c64829ba80b26aa153875/?isAjax=true
and the render is handled in the optionsAction
method of
app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php
I'd look into if this is different on your system, either via a URL rewrite or a controller override of some kind. This may explain why this particular URL is ignoring the custom theme.
Good luck!
When creating any new theme or module you need to define registration.php file at root of your module or theme folder.
Always use theme name in lowercase, Because Magento used this standard
for theme name declaration.
You haven't any problem for keep Theme name in camelcase but use standard way is much appreciated.
You have to define registration.php file inside Magento_Theme folder, its in wrong place.
Correct diagram of theme structure will be below,
magento2
|_ app
|_ design
|_ frontend
|_ Custom
|_theme
|_Magento_Theme
|_templates
|_root.phtml - Copy of Luma
|_registration.php
|_theme.xml
Your path for registration.php is app\design\frontend\Custom\theme\registration.php
registration.php file :
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/Custom/theme',
__DIR__
);
your theme.xml file path will be,
app\design\frontend\Custom\theme\theme.xml
theme.xml file :
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Custom Theme</title>
<parent>Magento/luma</parent>
<media>
<preview_image>media/preview.jpg</preview_image>
</media>
</theme>
After all setup is completed, don't forget to run deploy command for the theme,
php bin/magento setup:static-content:deploy
Check inside your admin panel, Content -> Design -> Configuration
for set your custom theme.
Remove cache and check in the frontend.
Best Answer
Go to your extension's admin layout file or create one if you don't have yet.
default/default/layout/your_xml.xml
and add this in default section:
I haven't tested but should work. Good luck.