当前位置: 动力学知识库 > 问答 > 编程问答 >

instamojo - Magento Shopping cart empty for cancelled payments

问题描述:

I'm using Instamojo in the payment section. For a cancel payment or a failure payment, the cart gets empty. How can it be overcome?

I want to save the cart item for unsuccessful payment attempts.

I used to replace this:

$this->getOnepage()->getQuote()->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;

}

$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));

With this one:

 /**

* 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;

$this->getOnepage()->getQuote()->setIsActive(1) ;

}

$this->getOnepage()->getQuote()->save();

$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));

in /app/code/core/Mage/Checkout/controllers/OnepageController.php

but it's not working.

分享给朋友:
您可能感兴趣的文章:
随机阅读: