Up Arrow

Magento: Place Order Did Not Work in One Page Checkout after Upgrading the Version from 1.7 to 1.9

  • Date: January 26th, 2017 | by Samrat Azad
  • Facebook
  • Tweet
  • Googleplus
  • IN
magento add to cart error

In Magento, i found a problem after upgrading the version from 1.7 to 1.9, after add to cart a product when I click on “Place order” button from one-page checkout it does not proceed to order success page but stay on the same page after displaying the image attempts to load for a flick second.

After inspecting the issue, I found that when “Place order” button is clicked Magento sends an AJAX request to this http://www.your-domain.com/index.php/checkout/onepage/saveOrder/ URL with POST method and the status code return from the server is 302 which means Moved Temporarily.

As you can see in the above image (in chrome browser with inspect element on Network tab), after clicking place order it sends a request to /checkout/onepage/saveOrder/ and the status code from the server is 302 Moved Temporarily.

Now to know why the server returned 302 I checked app/code/core/Mage/Checkout/controllers/OnepageController.php this file (which is upgraded to 1.9 controller file)  and see

so it has a form key validation at the very beginning of the method saveOrderAction.

then i compare this file with same (app/code/core/Mage/Checkout/controllers/OnepageController.php) older version 1.7 file and i found in older version 1.7 does not any form key validation.

The problem happened when i upgraded the version from 1.7 to 1.9, the system updated only the magento core files but not my custom theme files which should send a validation key along with from data to place a new order.

To get this issue resolved /app/design/frontend/default/your-theme/template/checkout/onepage/review/info.phtml open this file with your favorite editor and replace the following code (you will find this snippet at the end of the file).

with this.

That is it. Same thing may also happen if you applied newly released patch to your older magento versions like 1.7 or 1.8.

Recent Posts