Question

I am using Magento Enterprise, with a Datacash 3D Secure payment module.

In the event of an error during the payment process I want the user returned to the onepage checkout with their basket intact. Currently when the user returns to the checkout the basket is empty so they are then forwarded to the "checkout/cart" because they have no items.

I thought it might be a problem with my code so I have the initial payment action redirecting straight away with an error back to the onepage checkout.

 public function redirectAction() {
  Mage::getSingleton('core/session')->addError("There was a problem with the payment gateway. Please try again");
  $session = Mage::getSingleton('checkout/session');
  return $this->_redirect('checkout/onepage/', array('_secure'=>true));
}

However on returning to the checkout page the basket is empty. Adding in the following log into the indexAction of the onepage checkout I get "Quote ". Looking in the database the quote has had its active status set to 0.

 error_log("Quote ".Mage::getSingleton('checkout/session')->getQuoteId());

I have not came across this problem with the standard Magento only with Enterprise. Has anyone come across this issue? Ideally I do not want customers having to add products to the basket again. Its like its conflicting with some sort of Magento Enterprise module.

Thanks in advance for any help!

Was it helpful?

Solution

Basically you answered your own question. load the quote (if it's not available) and perform this:

$yourQuote()->setIsActive(true);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top