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 🙂
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.
- Checks if the users IP is not an allowed developer and display the Magento 404 page
- Store the parameter in a variable
- Load the order
- Set the three required session variables LastOrderId, LastSuccessQuoteId, LastQuoteId
- 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.