In Magento 1, it was possible to
-
Configuration a user interface for the System Configuration section in
etc/system.xml
files -
Set default values for those fields in the
etc/config.xml
files
Behind the scenes Magento would load data from core_config_data
, and if nothing was set, would default to the values set globally in etc/config.xml
. (simplified version — it's a little more complicated than that)
Can the same thing be done in Magento 2? I know it's possible to configure UI elements via system.xml
— but is it possible to set default values for these settings? If so, where or how should these values be configured?
Best Answer
yes, Magento 2 still allows you to define the default values inside a configuration file. namespace\modulename\etc\config.xml
System configuration system.xml