开发者

Magento Extending Paypal Standard - Can't instantiate Model

I am working with Paypal 1.4.2

I have extended Paypal S开发者_开发技巧tandard module to allow for some custom coding

My config.xml file looks like the following:

<?xml version="1.0"?>
<config>
<modules>
    <XYZ_Paypal>
        <version>1.0.0</version>
    </XYZ_Paypal>
</modules>

<global>
    <models>
        <paypal>
            <rewrite>
                <standard>XYZ_Paypal_Model_Standard</standard>
            </rewrite>

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

Now When i am trying to checkout using paypal i am getting the following error:

Fatal error: Call to a member function getPaypalUrl() on a non-object in /var/www/magento/app/code/core/Mage/Paypal/Block/Standard/Redirect.php on line 33

Looks like it can't instantiate Standard Class object as Line 33 is as follows:

$form->setAction($standard->getConfig()->getpaypalUrl())


Please merge the two rewrite statements:

...
    <paypal>
        <rewrite>
            <standard>XYZ_Paypal_Model_Standard</standard>
            <ipn>XYZ_Paypal_Model_Ipn</ipn>
        </rewrite>
    </paypal>
...

Also make sure that:

  1. The classname of your model matches exactly (case sensitive)
  2. The path to your class matches exactly (case sensitive)
  3. You are extending from the original class.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜