File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -69,13 +69,27 @@ public function successAction() {
6969 public function failureAction () {
7070 Mage::getSingleton ('core/session ' )->unsHyperRedirectUrl ();
7171 Mage::getSingleton ('core/session ' )->unsHyperReviewRedirect ();
72+ $ session = Mage::getSingleton ('checkout/session ' );
73+ if ($ session ->getLastRealOrderId ()) {
74+ $ order = Mage::getModel ('sales/order ' )->loadByIncrementId ($ session ->getLastRealOrderId ());
75+ if ($ order ->getId ()) {
76+ $ order ->setState (Mage_Sales_Model_Order::STATE_NEW , true )->save ();
77+ }
78+ }
7279 echo '<script type="text/javascript">window.top.location.href = " ' . Mage::getUrl ('checkout/onepage/failure ' ) . '"; </script> ' ;
7380 //$this->_redirect('checkout/onepage/failure');
7481 }
7582
7683 public function cancelAction () {
7784 Mage::getSingleton ('core/session ' )->unsHyperRedirectUrl ();
7885 Mage::getSingleton ('core/session ' )->unsHyperReviewRedirect ();
86+ $ session = Mage::getSingleton ('checkout/session ' );
87+ if ($ session ->getLastRealOrderId ()) {
88+ $ order = Mage::getModel ('sales/order ' )->loadByIncrementId ($ session ->getLastRealOrderId ());
89+ if ($ order ->getId ()) {
90+ $ order ->setState (Mage_Sales_Model_Order::STATE_NEW , true )->save ();
91+ }
92+ }
7993 echo '<script type="text/javascript">window.top.location.href = " ' . Mage::getUrl ('checkout/onepage/failure ' ) . '"; </script> ' ;
8094 //$this->_redirect('checkout/onepage/failure');
8195 }
You can’t perform that action at this time.
0 commit comments