问题描述:

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.

相关阅读:
Top