Magento – Overriding Third Party Adminhtml Controller

adminadminhtmlextendoverrides

I can't override another third party module:

I tried either of these but no success:

<admin>
    <routers>
        <thirdparty>
            <args>
                <modules>
                    <my_filedownloads before="ThirdParty_Adminhtml">My_FileDownloads_Adminhtml</my_filedownloads>
                </modules>
            </args>
        </thirdparty>
        <adminhtml>
            <args>
                <modules>
                    <my_filedownloads before="Mage_Adminhtml">My_FileDownloads_Adminhtml</my_filedownloads>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Best Answer

You're almost there:

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <my_filedownloads before="ThirdParty_Adminhtml">My_FileDownloads_Adminhtml</my_filedownloads>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Explanation: You add your router to the same front name as the other module (adminhtml) but your namespace should be used before the one of the other module (ThirdParty_Adminhtml)

So in the end, the priority is:

  1. MyFileDownloads_Adminhtml
  2. ThirdParty_Adminhtml
  3. Mage_Adminhtml

(actually with other modules in between that you don't care about because they will contain different controllers)

Related Topic