0

This is the model which I want to overwrite:

class Dotdigitalgroup_Email_Model_Newsletter_Sub extends Mage_Newsletter_Model_Subscriber
{
    public function sendConfirmationSuccessEmail()
    {
        if (Mage::helper('ddg')->isNewsletterSuccessDisabled($this->getStoreId())) {
            return $this;
        } else {
            parent::sendConfirmationSuccessEmail();
        }
    }
}

This is how it is declared in the config.xml , the models:

...
<models>
    <ddg_automation>
        <class>Dotdigitalgroup_Email_Model</class>
        <resourceModel>email_connector_resource</resourceModel>
    </ddg_automation>
....

This is my try:

<global>
    <models>
        <ddg_automation>
            <rewrite>
                <model>Aschroder_SMTPPro_Model_Newsletter_Sub</model>
            </rewrite>
        </ddg_automation>
.....

The the model:

class Aschroder_SMTPPro_Model_Newsletter_Sub extends Dotdigitalgroup_Email_Model_Newsletter_Sub
{
    public function sendConfirmationSuccessEmail()
    {
        parent::sendConfirmationSuccessEmail();
    }
}

and the settings:

<config>
    <modules>
        <Aschroder_SMTPPro>
            <active>true</active>
           <codePool>local</codePool>
            <depends>
                <Dotdigitalgroup_Email/>
            </depends>
       </Aschroder_SMTPPro>
    </modules>
</config>

It always gets to Dotdigitalgroup_Email_Model_Newsletter_Sub instead of Aschroder_SMTPPro_Model_Newsletter_Sub. Why ?

| improve this question | | | | |
1

In config.xml model rewrite seems wrong, try

<models>
    <smtppro>
        <rewrite>
            <SMTPPRO_MODEL_YOUR_WANT_TO_REWRITE>Dotdigitalgroup_Email_Model_Newsletter_Sub</SMTPPRO_MODEL_YOUR_WANT_TO_REWRITE>
        </rewrite>
    </smtppro>
<models>

Also this seems not to be correct in your model:

class Aschroder_SMTPPro_Model_Newsletter_Sub extends Dotdigitalgroup_Email_Model_Newsletter_Sub

Please add an link to this extension.

| improve this answer | | | | |

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.