I have just installed Magento 2 and am starting to go through the configuration.
In Stores > Configuration, I notice that the fields are all greyed out (under General for example) and a checkbox is ticked next to them saying "Use System Value".
After searching for a while, I found this link:
https://magento.stackexchange.com/a/146480/1884
So I think I have found the System values for this element, however, I assume I need to know how to override these defaults, instead of editing this file?
Am I correct in thinking this?
If so, How do I override this file. Where do I copy it to?
In Magento 1, it would be app/code/local… but in Magento 2?
Best Answer
"Use system values" works as a "Restore to factory settings" feature.
Let me explain how the config section works.
The config values can come from the
config.xml
files of every module or from the database,core_config_data
table.If the
path
field from the database for a config setting matches the tag path from a config file, the database value will overwrite the value fromconfig.xml
.For example if you have a row in the db with the path
a/b/c
and the value5
and in aconfig.xml
you havethe application will use the db value
5
.What the
Use system value
does is to delete the row from the database for the patha/b/c
making Magento use the value fromconfig.xml
if needed.So don't be afraid to uncheck the "Use system value" checkbox and change in the UI to what you need.
But if you really want to change this value you will have to add some xml markup in one of your
config.xml
files of one of your modules.For example, if you want to change the value of
max_depth
from the catalog moduleyou need to create your own module that is loaded after the catalog module (just add
<sequence><Magento_Catalog /></sequence>
in themodule.xml
file) and make yourconfig.xml
file look like this