Working on your Magento success page

We here at iFuel have a pretty lengthy QA process, which includes the carts success page. Sometimes we’ll go through a few iterations of the success page until it’s pixel perfect. Usually we’ll just edit the core on staging to remove the line of code that clears the session so the page doesn’t redirect on refresh.

You can download the extension here if you don’t want to read through the post 🙂

appcodecoreMageCheckoutcontrollersOnepageController.php

So to avoid having to edit the core we’ve created an extension that allows you to load a specific orders success page without rewriting or editing the core.

Once installed go to the test url (yourstore.com/successtest/index/test?order_id=) and you’ll be redirected to the success page.
In the code above we created a new controller and an action method with the following logic.

  1. Checks if the users IP is not an allowed developer and display the Magento 404 page
  2. Store the parameter in a variable
  3. Load the order
  4. Set the three required session variables LastOrderId, LastSuccessQuoteId, LastQuoteId
  5. Redirect to the success page

If you’d like we have created a full extension you can download it here. Enjoy an easier way of editing the success page now.