113 votes

Required parameter 'theme_dir' was not passed

Just in case if you are removing theme directly(Not in Magento way). Then follow these steps. STEP 1 : File Operations Delete the content from app/design/frontend/<Vendor> (make sure you ...
user avatar
95 votes
Accepted

Magento 2 backend session timeout

Stores > Settings > Configuration > Advanced > Admin > Security > Admin Session Lifetime (seconds) Also, there is a possibility to set this parameter directly to the database, just put a value ...
user avatar
58 votes
Accepted

Magento 2: Default Values for `system.xml` Configuration

yes, Magento 2 still allows you to define the default values inside a configuration file. namespace\modulename\etc\config.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/...
user avatar
  • 2,002
56 votes
Accepted

Magento 2 - How to get the extension's configuration values in the phtml files?

You can create a function for getting configuration values in your custom module's helper. <?php namespace Vendor\Module\Helper; class Data extends \Magento\Framework\App\Helper\AbstractHelper { ...
user avatar
  • 1,622
51 votes
Accepted

How can I change the default product images sizes on Magento 2?

Magento uses the file called view.xml which is maintained at the theme level of the application. So for example, if you are using the default theme luma you should find the view.xml under vendor/...
user avatar
51 votes
Accepted

Magento 2 : Field depends in system.xml when fields are not in the same group

Field id from depends node must contain section, group and field id's of the field you want to depend <depends> <field id="section_id/group_id/field_id">1</field> </depends&...
user avatar
  • 2,767
44 votes
Accepted

Magento CSS and JavaScript not loading due to using file system path

Magento using full path urls to access CSS files is a common error that results from two things happening: Having Merge CSS Files Enabled Magento being unable to read/write to the media/ folder. To ...
user avatar
  • 1,642
39 votes

Magento 2 - Homepage is 404

It can happen if one of the products is miss-configured/bad-saved/bad-imported especially url_rewrite table is missing request_path value. What i did to fix it... Open MySQL console & run this ...
user avatar
  • 541
34 votes
Accepted

Magento 2.2.0 missing admin developer configuration

Check your Deployment Mode it is in Production. To enable the developer tab menu under the Advanced You need to change it to Developer Mode So run this command : php bin/magento deploy:mode:set ...
user avatar
  • 9,580
33 votes
Accepted

Required parameter 'theme_dir' was not passed

This error message means that you have a theme configured which doesn't exist on the file-system (any more). It can be easily fixed by selecting a valid theme instead. Go to Content -> Configuration, ...
user avatar
  • 2,721
31 votes
Accepted

Magento 2. Retrieve information from env.php programmatically

Have a look at \Magento\Framework\App\DeploymentConfig: Inject a deployment config object of \Magento\Framework\App\DeploymentConfig in your code private DeploymentConfig $deploymentConfig; public ...
user avatar
  • 17.2k
29 votes

How to change the Admin session time in Magento?

There's an menu item for this in: Stores > Configuration > Advanced > Admin > Security > Session Lifetime (Seconds) Also check the php environment variables php_value session....
user avatar
  • 393
25 votes
Accepted

How can I set per-website defaults in config.xml?

You can add this using the <stores> node in your config.xml as follows. <stores> <store_code> You can also do this on website level with the <websites> node in your ...
user avatar
25 votes
Accepted

How to create a input tag have disable attribute in system.xml Magento 2

I think <frontend_model> works for you as like Magento1 <field id="recipient_email" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> ...
user avatar
  • 17.5k
25 votes
Accepted

Magento 2: Programmatically Add a Value to `core_config_data`

There is the same saveConfig method: https://github.com/magento/magento2/blob/2.0.0/app/code/Magento/Config/Model/ResourceModel/Config.php#L26-L61 A usage example from the core: https://github.com/...
user avatar
24 votes

Magento 2: Programmatically Add a Value to `core_config_data`

I wouldn't use a model or a resource model, but \Magento\Framework\App\Config\Storage\WriterInterface or \Magento\Framework\App\Config\ConfigResource\ConfigInterface (the first delegating to the ...
user avatar
  • 1,666
24 votes

Where do I find the SYSTEM VALUE defaults? magento 2.1

The system values are the default values each module can define in its config.xml. These are values that you can not change, the checkbox is something like "reset to manufacturers settings". This ...
user avatar
21 votes

How to add a custom helper in my module?

Create: app/code/Company1/Module1/composer.json { "name": "company1/module-module1", "description": "", "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/framework": "...
user avatar
  • 34.3k
20 votes

Magento 2 backend session timeout

Check attached image screenshot for better understanding of admin process. Go to Stores->Settings->Configuration->Advanced->Admin->Security->Admin Session Lifetime (seconds) And check screenshot.
user avatar
19 votes
Accepted

what is the difference between disable module output and module active = true

System > Configuration > Advanced > Disable Modules Output will not actually disable that module. It work as the name suggest, disable modules output. When you look at abstract class ...
user avatar
  • 17.5k
19 votes
Accepted

How to get store admin email address and name in Magento 2?

Try the below code - <?php namespace Custom\Module\Controller\Index; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Store\Model\ScopeInterface; class Index extends \Magento\...
user avatar
18 votes

How do I enable version 1.9 maintenance flag with admin access

Here's one solution: Open index.php in root and add (remembering to edit the ‘allowed’ array to contain the IP’s you want to be able to access the site); $ip = $_SERVER['REMOTE_ADDR']; $allowed = ...
user avatar
  • 682
18 votes
Accepted

Magento 2: Does Module Sequence Impact Layout Handle XML Loading Order?

The sequence in module.xml has an impact on app/etc/config.php. This file gets updated when you run bin/magento module:enable Vendor_ModuleName so if you have added/changed sequences I'd suggest ...
user avatar
17 votes

How to change the Admin session time in Magento?

Solution for Magento 2.0 For Magento 2 it can be found in Left Hand Panel on the Admin. Stores > Configuration > Advanced > Admin > Security Admin Session Lifetime (seconds) option in the main ...
user avatar
  • 530
16 votes
Accepted

How can I have a custom XML file in modules merged as one in Magento 2? (MageStackDay mystery question 2)

In Magento 2 this is handled by the \Magento\Framework\Config\Reader\Filesystem class. This class allows you specify the xml file you want to merge. The following part will merge all files found in ...
user avatar
16 votes
Accepted

Magento 2: How to Check if a Module's Installed

Maybe you are looking for this? lib/internal/Magento/Framework/Module/Manager.php /** * Whether a module is enabled in the configuration or not * * @param string $moduleName Fully-qualified ...
user avatar
  • 3,768
16 votes
Accepted

Create beautiful image upload in configuration magento 2

In system.xml you should add this code below: <field id="upload_image_id" translate="label comment" type="image" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1"> <...
user avatar
  • 3,638
16 votes
Accepted

How can I set configuration values in Magento 2?

This seems to work: class InstallData implements InstallDataInterface { public function __construct( LoggerInterface $loggerInterface, \Magento\Framework\App\Config\...
user avatar
16 votes
Accepted

Magento 2 - How to read the values in etc/config.xml?

You cannot read the values directly from etc/config.xml. I mean, you can, but there is no point in reading directly from there since the values may be overwritten from the stores->configuration ...
user avatar
  • 195k
15 votes
Accepted

Check if EE version or CE by code

Since CE 1.7 you have Mage::getEdition() that gives this information: /** * Magento edition constants */ const EDITION_COMMUNITY = 'Community'; const EDITION_ENTERPRISE = 'Enterprise'; const ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible