Bei den system.xmlDateien funktioniert es nicht so wie bei den Klassendateien. Die system.xmlDateien werden von den aktiven Modulen von Magento gesammelt. Das Kopieren eines localOrdners bedeutet nicht, dass es sich in einem Modul befindet, da die Moduldeklarationsdatei weiterhin besagt, dass das Modul zum coreCodepool gehört.
Wenn Sie einem Abschnitt neue Felder hinzufügen oder einige der Felder überschreiben möchten, müssen Sie ein eigenes Modul erstellen.
Hier ist ein Beispiel, wie Sie ein neues Feld im Abschnitt hinzufügen Catalog->Frontendund eines im selben Abschnitt überschreiben können.
Nehmen wir an, Ihr Modul heißt Easylife_Catalog.
Sie benötigen die folgenden Dateien:
app/etc/modules/Easylife_Catalog.xml- die Deklarationsdatei
<?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 - die Konfigurationsdatei
<?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-> configuration file
Nehmen wir an, Sie möchten das List ModeFeld so ändern , dass es nur auf globaler Ebene verfügbar ist (keine Website- und Store-Ansichtsebene). Der Einstellungspfad ist catalog/frontend/list_mode. Dann wird das system.xmlso aussehen:
<?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>
Angenommen, Sie möchten ein neues Feld hinzufügen, das customim selben Konfigurationsabschnitt aufgerufen wird. Nun wird die obige 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>
Ich weiß nicht, ob es eine Methode gibt, um ein Feld mit dieser Methode aus der Konfiguration zu entfernen. Ich habe danach gesucht, aber nichts gefunden.