I Hope, This instruction will be helpful for you.
Happy Coding with magento2!! ?
If you have any difficulties regarding this blog, do consider them posting in the Comments section below!
I’m here to help.
Thank you!
The app/etc/config.php file is used to manage to enable/disable the modules in Magento 2 but it is used for other purposes as well which will reduce our manual work for many developers.
The config.php file contains the following sections:
Manage the status(enable/disable) of the modules.
When we want to disable all the unnecessary/unused modules from the Magento 2 then instead of disabling the modules from each developer system, we can disable the modules from the config.php file .
The value 1 sets a module as enabled and 0 sets as disabled.
Suppose we wanted to disable modules from the Magento installation, the below snippet should do the job.
'modules' => [ 'Magento_Theme' => 0, 'Magento_Backend' => 0, ]
Suppose we wanted to enable modules from the Magento installation, the below snippet should do the job.
'modules' => [ 'Magento_Store' => 1, 'Magento_Eav' => 1 ]
Create websites, store groups, and store views with the required information.
We are working with a project which contains multiple websites/store groups/store views and when we have more developers in the team then instead of creating the websites/store groups/store views from the admin panel in each developer system, we can add the code in the config.php file. This file can be pushed to the version control tool from there the developers can pull the code and run the setup:upgrade or app:config:import command which will create the websites/store groups/store views.
'scopes' => [ 'websites' => [ 'admin' => [ 'website_id' => '0', 'code' => 'admin', 'name' => 'Admin', 'sort_order' => '0', 'default_group_id' => '0', 'is_default' => '0' ], 'base' => [ 'website_id' => '1', 'code' => 'base', 'name' => 'Singapore Website', 'sort_order' => '0', 'default_group_id' => '1', 'is_default' => '1' ], 'india' => [ 'website_id' => '3', 'code' => 'india_website', 'name' => 'India Website', 'sort_order' => '20', 'default_group_id' => '3', 'is_default' => '0' ] ], 'groups' => [ [ 'group_id' => '0', 'website_id' => '0', 'name' => 'Default', 'root_category_id' => '0', 'default_store_id' => '0', 'code' => 'default' ], [ 'group_id' => '1', 'website_id' => '1', 'name' => 'Dubai Website Group', 'root_category_id' => '2', 'default_store_id' => '1', 'code' => 'main_website_store' ], [ 'group_id' => '3', 'website_id' => '3', 'name' => 'Mumbai Website Group', 'root_category_id' => '2', 'default_store_id' => '3', 'code' => 'mumbai_website_group' ] ], 'stores' => [ 'admin' => [ 'store_id' => '0', 'code' => 'admin', 'website_id' => '0', 'group_id' => '0', 'name' => 'Admin', 'sort_order' => '0', 'is_active' => '1' ], 'default' => [ 'store_id' => '1', 'code' => 'default', 'website_id' => '1', 'group_id' => '1', 'name' => 'Singapore Store View', 'sort_order' => '0', 'is_active' => '1' ], 'mumbai_store' => [ 'store_id' => '3', 'code' => 'mumbai_eng_store', 'website_id' => '3', 'group_id' => '3', 'name' => 'Mumbai English Store View', 'sort_order' => '20', 'is_active' => '1' ], 'mumbai_store_andh' => [ 'store_id' => '4', 'code' => 'mumbai_andh_store', 'website_id' => '3', 'group_id' => '3', 'name' => 'Mumbai Andh Store View', 'sort_order' => '30', 'is_active' => '1' ] ] ],
Manage the system configuration values.
We can maintain the same system configuration values across all the developers within a team so the developers no need to make the changes manually.
We can define the values in all the scopes(Global, Website, Store view), we will need to add the values inside the particular scope with the config path.
Once the values are defined in the config.php file they can’t be changed from the admin panel. The values which are defined on the config.php file will take the top priority.
'system'=> [ 'default' =>[ 'checkout' => [ 'cart' => [ 'delete_quote_after' => 31 ] ] ] ]
Contains an array of values for theme configuration.
I Hope, This instruction will be helpful for you.
Happy Coding with magento2!! ?
If you have any difficulties regarding this blog, do consider them posting in the Comments section below!
I’m here to help.
Thank you!
Click one of our contacts below to chat on WhatsApp