Stop Magento 1 Redirecting to Empty Cart on Success.phtml

Posted on January 22, 2012 | Magento 1

Recently when trying to modify the success.phtml section in magento, I found it very frustrating the fact you had to make new fake orders to see your modified file. Of course I could have used firebug or some extension like that but I much prefer making modifications and hitting refresh.

After a little digging into the core files, I managed to find a solution.

Open: app/code/core/Mage/Checkout/controllers/OnepageController.php

There is no need to move this file to local (unless you have already modified this file, so use the local version instead) as it’s only a temporary modification, obviously you don’t want this on the live site so *remember to undo this change when finished*.

Change: (Line:227 in 1.6.1.0)

$session->clear();

To:

//$session->clear();

Simple as that, hope this helps.