3

I got a problem in overriding magento model local extension.

Here is my module config:

etc/modules/Mycompany_OrderExport.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Mycompany_OrderExport>
            <active>false</active>
            <codePool>local</codePool>
            <depends>
                 <Xtento_OrderExport />
            </depends>
        </Mycompany_OrderExport>
    </modules>
</config>

And here is my extension config: app/code/local/Mycompany/OrderExport/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Mycompany_OrderExport>
            <version>0.1.0</version>
        </Mycompany_OrderExport>
    </modules>
    <global>
        <models> 
            <orderexport>
                <class>Mycompany_OrderExport_Model</class>
            </orderexport>
            <xtento_orderexport> 
                <rewrite>
                     <export_data_shared_items>Mycompany_OrderExport_Model_Xtento_Export_Data_Shared_Items</export_data_shared_items> 
                 </rewrite>
             </xtento_orderexport> 
        </models>
    </global>
</config>

and here is my model:

<?php
class Mycompany_OrderExport_Model_Xtento_Export_Data_Shared_Items extends Xtento_OrderExport_Model_Export_Data_Shared_Items
{
    public function getExportData($entityType, $collectionItem)
    {

        echo 'Override';
        die(1);
    }
}
?>

I would like to know where part I have missed on my script ? Because when I execute my script there's nothing's happen. Thank you for your help.

2

This is the part that makes problem here.

    <Mycompany_OrderExport>
        <active>false</active>
        <codePool>local</codePool>
        <depends>
             <Xtento_OrderExport />
        </depends>
    </Mycompany_OrderExport>

You have disabled your module by setting the active node as false. Turn it on. Means put true for active. Make sure module is enabled through admin side. You can do this by go to

 System  >  Configuration  >  Advanced

Clear all cache and then try again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.