0

with this code (config.xml on my custom module):

<core>
<rewrite>
    <email_template>Company_Pluginname_Model_Email_Template</email_template>
    <email_template_mailer>Company_Pluginname_Model_Email_Template_Mailer</email_template_mailer>
</rewrite></core>

I override successfully the first model (Mage_Core_Model_Email_Template). But the second, Mage_Core_Model_Email_Template_Mailer not works... why? Thanks!

1 Answer 1

1

Here are some common overwrite issues that you can look out for:

  • Wrong class definition. Your class should be something like class Company_Pluginname_Model_Email_Template_Mailer extends Mage_Core_Model_Email_Template_Mailer
  • Wrong class file name. Your class file should be case sensitive app/code/[community|local]/Company/Pluginname/Model/Email/Template/Mailer.php
  • Cache not cleared after config.xml changes
  • Module dependencies not properly configured in the module definition XML files. In your case, in app/etc/modules/Company_Pluginname.xml you should have a <depends><Mage_Core /></depends> node.
  • Overwritten resource is already overwritten by another module. You could grep the PHP code for the base class name Mage_Core_Model_Email_Template_Mailer, or config.xml files for email_template_mailer to check if this is the case

Cheers

1
  • Thanks for your reply. I made everything fine, but I forgot the <depends> node on config xml.
    – Infocurci
    Aug 4, 2015 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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