If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

Magento. How to edit order confirmation page

Magento. How to edit order confirmation page

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

Magento_How_to_edit_Order_Confirmation_page_1

  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, perform the following steps:

    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:

      Magento_How_to_edit_Order_Confirmation_page_2

      Magento_How_to_edit_Order_Confirmation_page_3

    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:

      replace

      $session->clear();

      with:

      //$session->clear();
  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:

    Magento_How_to_edit_Order_Confirmation_page_4

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

      Replace

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

      with

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

        <br />
        <br />
        <p>Shipping Details</p>
        <?php
        /* 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);?>
      <?php
        /* Get shipping method  */
        ?>
        <?php $shipping_method = $order_details->_data["shipping_description"];?> 
        <?php
        /* Get ship-to address information  */
        ?>
        <?php $shipping_address_data = $order_details->getShippingAddress();?> 
        <?php
        /* 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, for example social-buttons-block, 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();?>
      

Magento_How_to_edit_Order_Confirmation_page_5

You may also need to clear the cache.

Feel free to check the detailed video tutorial below:

Magento. How to edit order confirmation page