0
votes

I need to override class Mage_Paypal_Model_Ipn.

class Budsies_Budsie_Paypal_Model_Ipn extends  Mage_Paypal_Model_Ipn
{
    protected function _processOrder()
    {
        Mage::log('Budsies_Budsie_Paypal_Model_Ipn', null, 'processOrder.log');
        $orderState = $this->_order->getState();
        if ($orderState != Mage_Sales_Model_Order::STATE_COMPLETE &&
                   $orderState != Mage_Sales_Model_Order::STATE_HOLDED) {
            parent::_processOrder();
        }
    }
}

I added config.xml to my module в global section:

  <global>
    <models>
        <paypal>
            <rewrite>
                <ipn>Budsies_Budsie_Paypal_Model_Ipn</ipn>
            </rewrite>
        </paypal>
    </models>
  </global>

But it doesn't work. What should be config file to make my class to rewrite core class. Could you please tell me what's the problem?

I corrected it, simply it's this section is larger and I made copy paste. But it doesn't work.

Thank you for your help. My rewrite works. The problem was that ipn for that account were not configured, there were not ipn, so this method wasn't called.

1
could you post your entire xml config?Antonino Bonumore

1 Answers

1
votes

If this is really what your XML looks like then it's this:

<global>
  <models>
      <paypal>
          <rewrite>
              <ipn>Budsies_Budsie_Paypal_Model_Ipn</ipn>
          </rewrite>
      </paypal>
  </models>
</global>

You had </models> in there twice and didn't have your </global> tag closed.