How to stop the Success page to Redirect in Magento 2

How to stop the Success page to Redirect

Working on the Checkout success page is hard because whenever developer refreshes that page to see his changes, the page redirects to another page and shows a message that Cart is Empty.

So how to stop that checkout success page redirection?

For this we have to edit Magento core file:

vendor/magento/module-checkout/Controller/Onepage/Success.php

at line number 22

$session→clearQuote(); commnet this line  //$session->clearQuote();

save the file, clear the cache and now check your checkout page I will not redirect anymore.

About Ejaz Alam

A Software Engineer who Believes in a simple lifestyle and follow a simple logic to make himself better than yesterday. :)

View all posts by Ejaz Alam →

Leave a Reply

Your email address will not be published. Required fields are marked *