Magento: Redirecting to Cart page from Checkout page after Place Order

Scenario:

I added products to cart. Then did proceed to checkout. I have tried Cash on Delivery and Check / Money Order as Payment method. Everything is fine until the order review section. And then when I click the Place Order button then it gets redirected to Cart page instead of going to Order Success page. The cart items are still there. However, it shows the order is placed when I go to My Orders section.

Solution:

The most probable cause of such type of issue is missing any PHP extension on the server where you are hosting your website.

Such case arises, when you are moving your website from localhost to online server. Or, moving your site from one server to another server.

To debug the issue, you can enable display_errors in your index.php file.


ini_set('display_errors', 1);

Then on your checkout page, you can check the error output on Firebug or similar debugger.

Firebug debug

The error as displayed in above figure says “Call of undefined function mb_convert_encoding()“. This indicates that PHP extension php-mbstring is required by Magento but it’s not installed in the system.

This issue will be solved after we install php-mbstring extension on the server and then restart Apache.

Here is the shell command for CentOS to install php-mbstring and restart apache:


# install php-mbstring
sudo yum install php-mbstring 

# restart apache
service httpd restart

Hope this helps.
Thanks.