Magento Forum

   
How to override config.xml configuration? 
 
Dmitrius
Jr. Member
 
Total Posts:  5
Joined:  2008-11-30
 

I want to override following section of customer config.xml:

<global>
        <
customer>
            <
address>
                <
formats>
                    <
text translate="title" module="customer">
                        <
title>Text</title>
                        <
defaultFormat><![CDATA[
{{depend prefix}}{{var prefix}} {{
/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}
{{depend company}}{{var company}}{{
/depend}}
{{var street1}}
{{depend street2}}{{var street2}}{{
/depend}}
{{depend street3}}{{var street3}}{{
/depend}}
{{depend street4}}{{var street4}}{{
/depend}}
{{depend city}}{{var city}}
,  {{/depend}}{{depend region}}{{var region}}{{/depend}}{{var postcode}}
{{var country}}
T
{{var telephone}}
{{depend fax}}F
{{var fax}}{{/depend}}
                        ]]
></defaultFormat>
                    </
text>
</
formats>
</
address>
</
customer>
</global>
Please rite me: what should i write in my custom module config.xml to override text inside <defaultFormat> ? Please help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

You use the exact same element layout.  Just put what you posted in your question into the config.xml for your module.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dmitrius
Jr. Member
 
Total Posts:  5
Joined:  2008-11-30
 

Thanks for your reply. I tried to do so, but it doesn’t work. It still uses configuration from core/customer config.xml.
I cleared cach before test run.

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

Are your sure your custom Module is being loaded then?  The way that the Magento config system works, if you specify the exact same element tree in your config.xml, it should over write the one that is loaded earlier.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dmitrius
Jr. Member
 
Total Posts:  5
Joined:  2008-11-30
 

Yes. i’m sure it loads, because classes i overrided in my custom module work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

Could you post you config.xml then?  Maybe I can spot something.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dmitrius
Jr. Member
 
Total Posts:  5
Joined:  2008-11-30
 

Here are files in attachment.
config.xml is file from Mage/Customer/etc
config_my.xml is file from my module, it contains some <fieldsets> tag alterations which don’t work too.

Thank you for your help.

File Attachments
configs.zip  (File Size: 5KB - Downloads: 293)
 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

Hey, looking at the config files, it all looks good.  The only thing I can come up with (after consulting with Vinai) is maybe the load order is messed up.  Do you have you module depending on the Mage_Customer module?  That is the only sure way to get your code loaded AFTER the Mage_Customer module.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dmitrius
Jr. Member
 
Total Posts:  5
Joined:  2008-11-30
 

Thanks you for your help. It was the case. I added depedencies and all started to work grin

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top