[contact-form-7 id="24078" title="Feedback EN"]

Featured templates

Magento. How to edit order confirmation page

Magento. How to edit order confirmation page

This tutorial shows how to edit the order confirmation page in Magento:


  1. Navigate to app/design/frontend/base/default/template/checkout/success.phtml inside your site directory on the server via FTP or on your hosting cPanel and copy the success.phtml file to the app/design/frontend/default/themeXXX/template/checkout folder.

  2. In order to test the changes, do the following:

    1. If your payment method is not Saved CC, set it to it in System -> Configuration -> Sales -> Payment Methods in your dashboard and use a test credit card to check out and get the success page to display. The Visa test card number is 4111111111111111:



    2. Temporarily edit a Magento Core code file to disable clearing session by commenting out this code around Line 227 in app/code/core/Mage/Checkout/controllers/OnepageController.php:




  3. In app/design/frontend/default/themeXXX/template/checkout/success.phtml you can edit the Order Confirmation Page code.

    We strongly recommend backing up the file before editing it:


    1. To edit the default text, replace the text between single quotes with yours. For example:


      <h1><?php echo $this->__('Your order has been received.') ?></h1>


      <h1><?php echo $this->__('Great, we got your order!!!') ?></h1>
    2. For displaying Shipping Address add this code:

        <br />
        <br />
        <p>Shipping Details</p>
        /* First, let's load some Load order details */
        <?php $order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();?>
        <?php $order_details = Mage::getModel('sales/order')->loadByIncrementId($order_id);?>
        /* Get shipping method  */
        <?php $shipping_method = $order_details->_data["shipping_description"];?> 
        /* Get ship-to address information  */
        <?php $shipping_address_data = $order_details->getShippingAddress();?> 
        /* Output the ship-to address information  */
        <?php echo "<br>" . $shipping_address_data['firstname'];?> 
        <?php echo " " . $shipping_address_data['lastname'];?> 
        <?php echo "<br>" . $shipping_address_data['street'];?> 
        <?php echo "<br>" . $shipping_address_data['city'];?> 
        <?php echo ", " . $shipping_address_data['region'];?> 
        <?php echo " " . $shipping_address_data['postcode'];?> 
        <?php echo "<br>" . $shipping_address_data['country_id'];?>
    3. This code will display Order Summary Amounts:

        <br />
        <br />
        <p>Order Amounts</p>
        <br />
        <?php /* Billing amounts */  ?>
        <?php /* These leverage the Magento core helper to format the numbers to currency */  ?>
        <?php echo '<p class="subtotal">Subtotal:<span class="amount">' . Mage::helper("core")->currency($order_details->subtotal)  . "</span></p>";?> 
        <?php echo '<p class="tax">Tax:<span class="amount">' . Mage::helper("core")->currency($order_details->tax_amount)  . "</span></p>";?> 
        <?php echo '<p class="discount">Discount:<span class="amount">' . Mage::helper("core")->currency($order_details->discount_amount) . "</span></p>";?> 
        <?php echo '<p class="paid">Amount Paid:<span class="amount">' . Mage::helper("core")->currency($order_details->total_paid) . "</span></p>";?> 
    4. In order to display a custom static CMS block like social-buttons-block, for example, use this code:

        <?php /* Loads the CMS static block directly */ ?>
        <?php /* Note: the identifier for the cms block in this example is social-buttons-block - adjust to suite your cms */ ?>
        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('social-buttons-block')->toHtml();?>


You may also need to clear the cache.

Feel free to check the detailed video tutorial below:

Magento. How to edit order confirmation page