Monday, April 18, 2016

How to override config.xml

Create your own module ([Namespace]_[Module]).
For this you need:
app/etc/modules/[Namespace]_[Module].xml - the declaration file
<?xml version="1.0"?>
<config>
    <modules>
        <[Namespace]_[Module]>
            <codePool>local</codePool>
            <active>true</active>
            <depends>
                <Mage_Contacts /><!-- so the config is loaded after the one from Mage_Contacts -->
            </depends>
        </[Namespace]_[Module]>
    </modules>
</config>
app/code/local/[Namespace]/[Module]/etc/config.xml - the configuration file
<?xml version="1.0"?>
<config>
    <modules>
        <[Namespace]_[Module]>
            <version>1.0.0</version>
        </[Namespace]_[Module]>
    </modules>
    <global>
        <template>
            <email>
                <contacts_email_email_template>
                    <type>html</type><!-- same xpath as in the original config file -->
                </contacts_email_email_template>
            </email>
        </template>
    </global>
</config>
Clear the cache and you are set to go.
Basically this is how you can overwrite any node from config.xml. Just create a module and in it's config.xml file replicate the original node path and add your value.