Для system.xmlфайлов это не работает, как для файлов классов. Эти system.xmlфайлы собраны из активных модулей Magento. Простое копирование одного в localпапку не означает, что он находится в модуле, потому что файл объявления модуля все еще говорит, что модуль принадлежит к coreпулу кодов.
Если вы хотите добавить новые поля в раздел или переопределить некоторые из полей, вам нужно создать свой собственный модуль.
Вот пример того, как вы можете добавить новое поле в раздел Catalog->Frontendи как вы можете переопределить его в этом же разделе.
Допустим, ваш модуль называется Easylife_Catalog.
Вам понадобятся следующие файлы:
app/etc/modules/Easylife_Catalog.xml- файл декларации
<?xml version="1.0"?>
<config>
<modules>
<Easylife_Catalog>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Catalog />
</depends>
</Easylife_Catalog>
</modules>
</config>
app/code/local/Easylife/Catalog/etc/config.xml - файл конфигурации
<?xml version="1.0"?>
<config>
<modules>
<Easylife_Catalog>
<version>0.0.1</version>
</Easylife_Catalog>
</modules>
</config>
app/etc/local/Easylife/Catalog/etc/system.xml- system-> файл конфигурации
Допустим, вы хотите изменить List Modeполе, чтобы оно было доступно только на глобальном уровне (без веб-сайта и уровня просмотра магазина). Путь установки есть catalog/frontend/list_mode. Тогда system.xmlбудет выглядеть так:
<?xml version="1.0"?>
<config>
<sections>
<catalog><!-- first part of the path -->
<groups>
<frontend><!-- second part of the path -->
<fields>
<list_mode><!-- third part of the path -->
<show_in_website>0</show_in_website><!-- this will override the core value -->
<show_in_store>0</show_in_store><!-- this will override the core value -->
</list_mode>
</fields>
</frontend>
</groups>
</catalog>
</sections>
</config>
Теперь предположим, что вы хотите добавить новое поле с именем customв том же разделе конфигурации. Теперь XML выше становится
<?xml version="1.0"?>
<config>
<sections>
<catalog><!-- first part of the path -->
<groups>
<frontend><!-- second part of the path -->
<fields>
<list_mode><!-- third part of the path -->
<show_in_website>0</show_in_website><!-- this will override the core value -->
<show_in_store>0</show_in_store><!-- this will override the core value -->
</list_mode>
<custom translate="label"><!-- your new field -->
<label>Custom</label>
<frontend_type>text</frontend_type>
<sort_order>1000</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</custom>
</fields>
</frontend>
</groups>
</catalog>
</sections>
</config>
Я не знаю, есть ли метод для удаления какого-либо поля из конфигурации с помощью этого метода. Я искал это, но ничего не нашел.