Magento rewrite controllers Enterprise_ImportExport

magento

Magento rewrite controllers Enterprise_ImportExport

All project I was joined are using rewrite block, model, helper or controllers. We need to change something, to add something new or to override something in core of Magento. Magento supported method way how to overwrite those these files.
And with Enterprise version, today I will demo rewrite a controllers: Enterprise_ImportExport_Adminhtml_Scheduled_OperationController

magento

 

Step 1: create OperationController.php controller file with content:

class KhacTung_ImportExport_Scheduled_OperationController extends Enterprise_ImportExport_Adminhtml_Scheduled_OperationController
{
    //code custom here
}

 

Step 2: In etc/config.xml, init router and attribute before=”Enterprise_ImportExport_Adminhtml”

<config>
	<admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <KhacTung_ImportExport before="Enterprise_ImportExport_Adminhtml">KhacTung_ImportExport</KhacTung_ImportExport>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

 

Last step, clear cache, reload and see result.

 

Thanks for watching!