/** * Submit the order */ public function placeOrderAction() { try { $this->_initCheckout(); $order = $this->_checkout->placeOrder($this->_initToken()); // prepare session to success page $quoteId = $this->_getQuote()->getId(); Mage::getSingleton('checkout/session')->setLastQuoteId($quoteId)->setLastSuccessQuoteId($quoteId)->setLastOrderId($order->getId())->setLastRealOrderId($order->getIncrementId()); $this->_initToken(false); // no need in token anymore $this->_redirect('checkout/onepage/success'); return; } catch (Mage_Core_Exception $e) { $this->_getSession()->addError($e->getMessage()); } catch (Exception $e) { $this->_getSession()->addError($this->__('Unable to place the order.')); Mage::logException($e); } $this->_redirect('*/*/review'); }