阅读788 返回首页    go 技术社区[云栖]


magento -- 根据支付类型定制结账成功页面

在Magento中,当订单完成会有一张成功页面来确认订单已经收到并显示订单编号。这会带了一个问题,当你使用非即时支付方式(比如Check/Money Order)时,客户需要知道这些支付方式的细节和步骤,完美的状态是客户一旦完成订货能立刻知道任何必要的付款信息。下面会告诉你怎样根据选择的支付方式定制化订单成功页面,用来显示非即时支付方式的细节,确保客户正确的完成支付过程。

    我们会用Check/Money Order 这个支付方式来做演示,最开始我们需要新建一个ID为"money_order_msg"静态区块,内容为"Your order will be processed as soon as payment has been received. Please make cheques payable to ACME Inc."

导入这个区块我们只需要下面这个模板文件

app/design/frontend/default/_your_theme_/template/checkout/success.phtml 

 

自定义代码最好插入到<div >标签上面:

 

<?php // Get the id of the order just made. $order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId()); // If the order was paid for by Check or Money Order, display the custom message if ($order->getPayment()->getMethod() == "checkmo") { echo $this->getLayout()->createBlock('cms/block')->setBlockId('money_order_msg')->toHtml(); } ?> 

 

这段代码会检索订单并检查支付方式是否是"checkmo",如果使用的是 Check/Money Order支付方式,我们的新区块就会放置到成功页面"Continue Shopping" 按钮的上方。

 

成功

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

原文地址:https://www.fontis.com.au/blog/magento/customise-magento-checkout-success-page-based-payment-type

最后更新:2017-04-02 04:26:02

  上一篇:go flv视频无法播放,显示video not found
  下一篇:go [Qt Topic] – 中文化研习,做一个多语言的简易天气预报器