Magento:在购物车上移动Paypal Express按钮

时间:2014-08-29 06:16:57

标签: magento paypal magento-1.8

我有一个magento网站,信用卡和paypal快速结账已启用作为付款方式,但在我的购物车上, Paypal Express结账按钮显示在"顶部"继续结帐"按钮,我希望这是另一种方式。

我已经更改了"排序" "付款方式"两种方法的顺序部分,但没有成功。

我该如何做到这一点?

2 个答案:

答案 0 :(得分:2)

如果您只想更改按钮的位置,那将不是很重要。我的意思是说这很简单。你只需要改变块的位置。

转到布局文件,即paypal.xml,它位于“app / design / frontend / base / default / layout / paypal.xml”。这里你应该搜索代码片段

<reference name="checkout.cart.methods">
            <block type="paypal/express_shortcut" name="checkout.cart.methods.paypal_express.bottom" before="-" template="paypal/express/shortcut.phtml">
                <action method="setIsQuoteAllowed"><value>1</value></action>
            </block>
        </reference>

这里将“之前”文本更改为“之后”。现在您可以检查前端,您可能会在进入结帐按钮后看到paypal按钮显示。

我的一个建议是不要对核心文件进行更改。首先将paypal.xml文件覆盖到您自己的主题上,然后对其进行更改。这是最佳实践。

希望这会有所帮助。

答案 1 :(得分:0)

除了@ aton1004的答案之外,我还需要另一行XML来移动单词&#39; - 或 - &#39;继续显示在PayPal按钮下方(显然,一旦PayPal按钮是底部选项,单词&#39; OR&#39;需要显示在PayPal按钮上方。)因此,我的paypal.xml中的最终XML块是:

<reference name="checkout.cart.methods">
    <block type="paypal/express_shortcut" name="checkout.cart.methods.paypal_express.bottom" after="-" template="paypal/express/shortcut.phtml">
        <action method="setIsQuoteAllowed"><value>1</value></action>
        <action method="setShowOrPosition"><value>before</value></action>
    </block>
</reference>