我们知道Magento程序在客户下单付款成功或是失败都会清空掉购物车,
来看看场景
如果我们有这样一个需求如下
当客户付款失败, 我们会跳到支付页面提示支付失败的原因,并让客户选择其他的支付方式,要实现这个需求的前提是购物车未清空.
修改,找到支付模块的saveOrderAction() 这里根据你的一页支付插件而定,这里我们以Firecheckout为例
找到/app/code/local/TM/FireCheckout/controllers/IndexController.php
$quote->save();
/**
* when there is redirect to third party, we don't want to save order yet.
* we will save the order in return action.
*/
if (isset($redirectUrl)) {
$result['redirect'] = $redirectUrl;
}
更新后的代码
//$quote->save();
/**
* when there is redirect to third party, we don't want to save order yet.
* we will save the order in return action.
*/
if (isset($redirectUrl)) {
$result['redirect'] = $redirectUrl;
}else{
$quote->save();
}
Magento提交订单会跳转到支付结果页面,我们需要将failure.phtml的内容修改成如下:
找到app/design/frontend/主题/default/template/checkout/onepage/failure.phtml
<?php if ($this->getRealOrd

本文介绍如何在Magento中实现当客户付款失败后不清除购物车,允许他们选择其他支付方式继续下单。主要涉及修改支付模块的saveOrderAction方法和调整支付失败页面及Checkout页面的相关提示。
最低0.47元/天 解锁文章
1889

被折叠的 条评论
为什么被折叠?



