我们知道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/tem