设置了系统的后台配置选项后,可以在config.xml中设置后台配置的默认值
设置配置项的默认值
<default>
<app_options>
<app_setting>
<user_name>老王</user_name>
<pass_word>laowang</pass_word>
</app_setting>
</app_options>
</default>
其中,app_options、app_setting、user_name、pass_word均为你在同一目录下的system.xml中配置的唯一标识符
打开后台,结果如下:

默认值不生效解决方法
配置默认值的优先级:数据库 >
xml配置文件
设置后台配置文件的默认值,需要将config.xml与systeml.xml同时提交后才会生效
若先提交了system.xml,并在后台查看配置已经生效了,此时系统会将配置存入core_config_data表中,存入的默认值为NULL,如下图所示,再提交config.xml的时候,由于数据库中已经存入默认值且为空,导致设置的默认值不生效

如果要让config.xml中设置的默认值生效,可以将数据库中配置的值对应的记录删除,清除magento缓存后重新进入后台查看,默认值生效
此时查看表core_config_data中配置项的值,跟设置的默认值一样了
