重写Mage_Paypal_Model_Express_Checkout

发布于 2024-10-27 05:47:09 字数 992 浏览 1 评论 0原文

我遇到了一个问题,即运输选项无法进入 PayPal Express 审核页面。如果买家输入了免运费优惠券,然后使用PayPal Express,当他们从PP网站返回时,提交订单的评论页面没有免运费选项。

我找到了一个线程,其中通过向 Mage_Paypal_Model_Express_Checkout 类添加代码来回答。此更改有效,但修改核心代码是禁忌,因此我尝试重写该类,但遇到了麻烦。我以前重写过核心类,但是这个有点不同,我无法弄清楚。有人能指出我正确的方向吗?

这是我的 config.xml 的内容。这看起来合适吗?

<config>
    <modules>
        <VPS_Paypal>
            <version>0.1.0</version>
        </VPS_Paypal>
    </modules>
    <global>
        <models>
            <paypal>
                <rewrite>
                    <express_checkout>
                        <class>VPS_Paypal_Model_Express_Checkout</class>
                    </express_checkout>
                </rewrite>
            </paypal>
        </models>
    </global>
</config>

I have run into a problem where shipping options are not making it to the PayPal Express review page. If the buyer enters a free shipping coupon and then uses PayPal Express, when they return from the PP website, the review page where the submit the order doesn't have the free shipping option.

I found a thread where this was answered by adding code to the Mage_Paypal_Model_Express_Checkout class. This change works, but modifying core code is a no-no, so I'm trying to rewrite the class and I'm having trouble. I've rewritten core classes before, but this one is different somehow and I can't figure it out. Can someone point me in the right direction?

here's the contents of my config.xml. Does this look right?

<config>
    <modules>
        <VPS_Paypal>
            <version>0.1.0</version>
        </VPS_Paypal>
    </modules>
    <global>
        <models>
            <paypal>
                <rewrite>
                    <express_checkout>
                        <class>VPS_Paypal_Model_Express_Checkout</class>
                    </express_checkout>
                </rewrite>
            </paypal>
        </models>
    </global>
</config>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七色彩虹 2024-11-03 05:47:09

我还没有测试过这个,但根据类名,我认为将其添加到您的配置部分会起作用:

        <paypal>
            <rewrite>
                <express_checkout>Your_Model_Class_Here</express_checkout>
            </rewrite>
        </paypal>

您的自定义类应该扩展 Mage_Paypal_Model_Express_Checkout 并且仅覆盖您想要更改的方法。

I haven't tested this, but based on the class name I would think that adding this to the section of your config would work:

        <paypal>
            <rewrite>
                <express_checkout>Your_Model_Class_Here</express_checkout>
            </rewrite>
        </paypal>

Your custom class should extend Mage_Paypal_Model_Express_Checkout and only override the method you want to change.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文