I'm trying to rename some of the credit cards which appear on my Magento checkout (e.g. "Visa" becomes "Visa Debit/Credit").
To do this, I discovered you must edit the names as defined in /app/code/core/Mage/Payment/etc/config.xml
.
Not wanting to overwrite core files, I tried copying this file to /app/code/local/Mage/Payment/etc/config.xml
and making my changes there, but it didn't work. From research, I gather than Magento doesn't autoload config files from local folders first?
I then discovered that you could change app/etc/modules/Mage_All.xml
and specify <codePool>local</codePool>
instead of <codePool>core</codePool>
under <Mage_Payment>
. My changes made under the local folder would then work.
Is this the correct approach? Will changing the codePool
of a core module have any repercussions? Is there some other way to "override" a core module's config.xml
?
You have to create a new module under local : Yourcompany_Payment
In this module, define a minimalist etc/config.xml with the XML rewrite you need :
<config>
<modules>
<Yourcompany_Payment>
<version>0.1.0.0</version>
</Yourcompany_Payment>
</modules>
<global>
<payment>
<cc>
<types>
<AE>
<code>AE</code>
<name>American Express</name>
<order>0</order>
</AE> [...]
And then in the app/etc/modules
folder, add a new Yourcompany_Payment.xml
(or Yourcompany_All.xml) with :
<config>
<modules>
<Yourcompany_Payment>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Payment/>
</depends>
</Yourcompany_Payment>
</modules>
</config>
The depends node is vital because it will tell magento to load your XML after magento's one in order to your rewrite to work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With