Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How To Override Admin Modules??????? 
 
Emperor
Sr. Member
 
Total Posts:  111
Joined:  2007-08-31
 

I want to be able to override some admin modules to customize the functionality of those modules.

How can this be done?

I just need for you guys to guide me in the right direction.

Please.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandlive_br
Guru
 
Avatar
Total Posts:  653
Joined:  2008-05-19
Buenos Aires, Argentina
 

You need to specify that override in the config.xml into the etc folder of your module.

A simple example. I use this to modify some block.

<?xml version="1.0"?>
<config>
    <global>
        <
blocks>
            <
googleanalytics>
                <
rewrite>
                  <
ga>Bl_GoogleAnalytics_Block_Ga</ga>
                </
rewrite>
            </
googleanalytics>
        </
blocks>
    </global>
</
config>

Of course, my class Bl_GoogleAnalytics_Block_Ga has the code that work like I need.

--
Damián

 
Magento Community Magento Community
Magento Community
Magento Community
 
Emperor
Sr. Member
 
Total Posts:  111
Joined:  2007-08-31
 

Would I do the same thing If I just wanted to extend the module?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandlive_br
Guru
 
Avatar
Total Posts:  653
Joined:  2008-05-19
Buenos Aires, Argentina
 

A good practice is never change the core code (because you gonan get troubles with the update).
Overriding classes is a good way to change the Magento behaivors (or add news).
Maybe you can try to creating a copy of the original and add your methods or changes.
Then, you ovverride the original with yours.

Maybe this help you.

--
Damián

 
Magento Community Magento Community
Magento Community
Magento Community
 
joey santiago
Sr. Member
 
Total Posts:  76
Joined:  2009-02-25
 

Sorry, i’m quite slow at understanding…

i need to override files /app/code/core/Adminhtml/Block/Catalog/Product/Grid.php and /app/code/core/Adminhtml/Block/Sales/Order/Grid.php .

So i put my new files in /app/code/local/MyCompany/Block/Catalog/Product/Grid.php and /app/code/local/MyCompany/Block/Sales/Order/Grid.php and in /app/code/local/Mycompany/etc/config.xml i should write the right directives… right?

can anyone help me with this? thank you very much! smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandlive_br
Guru
 
Avatar
Total Posts:  653
Joined:  2008-05-19
Buenos Aires, Argentina
 

Yes, that’s what you need to do.
Maybe you can try with a simple test, something like the example code that I post before.
Make the test and post Us you possible problems.

--
Damián

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