Magento 1.9 – Override Model from Community Module

magento-1.9modeloverrides

I would like to rewrite a model class which is in the community pool. I've looked for solution but I cannot managed to override a community module. Here's my module:

app/etc/Mycompany_Mymodule.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Mycompany_Mymodule>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Unirgy_Dropship/>
            </depends>
        </Mycompany_Mymodule>
    </modules>
</config>

Config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Mycompany_Mymodule>
            <version>0.1.0</version>
        </Mycompany_Mymodule>
    </modules>

    <global>
        <models>
            <unirgy_dropship>
                <rewrite>
                    <pdf_shipment>Mycompany_Mymodule_Model_Pdf_Shipment</pdf_shipment>
                </rewrite>
            </unirgy_dropship>
        </models>
    </global>
</config>

Could you tell me what I am doing wrong please ? thanks

Best Answer

just try with below tag in config.xml

you can see model path tag is different in unirgy drop ship module

 <models>
     <udropship>
            <rewrite>
                <pdf_shipment>Mycompany_Mymodule_Model_Pdf_Shipment</pdf_shipment>
            </rewrite>
     </udropship>
 </models>

i am sure it will work for you

Related Topic