0
<global>
  <models>
    <sales>
      <rewrite>
      <order_pdf_invoice>Local_Extension_Model_Sales_Order_Pdf_Invoice</order_pdf_invoice>
      </rewrite>
    </sales>
  </models>
</global>

This is in the local extension that Im trying to override.

So in my /etc/extension.xml file I put that it depends on Local_Extension, I also put it in my etc/config.xml file I then used the exact same rewrite as they did in their config.xml but using my path and when I look at the Modules conflict detector it says that my class overrode the class, but it is not being used.

In that same Modules Conflict Detector it shows the initial class being

Mage_Sales_Model_Order_Pdf_Invoice

and the rewrites are

MyCompany_InvoicePdf_Model_Sales_Order_Pdf_Invoice
Local_Extension_Model_Sales_Order_Pdf_Invoice

the Local_Extension is green which means it's being used and MyCompany is red saying "Red class name means that probably there is conflict. Initial class has been overwritten by this class, but this class is not used.

You should check if this class doesn't contain any important methods or changes, which should be used."

In my class file Invoice.php the first line is:

class MyCompany_InvoicePdf_Model_Sales_Order_Pdf_Invoice extends

Local_Extension_Model_Sales_Order_Pdf_Invoice

But I must be missing something...? Any help!? Thanks! :)

0

app/code/local/Thenew/Module/etc/config.xml

...
<global>
  <models>
    <local_localmodule>//the first one
      <rewrite>
          <model>Thenew_Module_Model_Sales_Order_Pdf_Invoice</model>//the new one
      </rewrite>
    </local_localmodule>
  </models>
</global>
...

app/etc/modules/Thenew_Module.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Thenew_Module> //the new one
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <local_localmodule/>//the local one that you want to rewrite
            </depends>
        </Thenew_Module>
    </modules>
</config> 

So here Magento loads first Local_Localmodule then Thenew_Module

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.