- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
Magento. How to edit order confirmation page
August 24, 2015
Magento. How to edit order confirmation page
This tutorial shows how to edit order confirmation page in Magento:
-
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.
-
In order to test the changes, perform the following steps:
-
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:
- 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();
-
-
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:
-
To edit the default text, replace the text between single quotes with yours. For example:
Replace
__('Your order has been received.') ?>
with
__('Great, we got your order!!!') ?>
-
For displaying Shipping Address add this code:
Shipping Details
getLastRealOrderId();?> loadByIncrementId($order_id);?> _data["shipping_description"];?> getShippingAddress();?> " . $shipping_address_data['firstname'];?> " . $shipping_address_data['street'];?> " . $shipping_address_data['city'];?> " . $shipping_address_data['country_id'];?> -
This code will display Order Summary Amounts:
Order Amounts
Subtotal:' . Mage::helper("core")->currency($order_details->subtotal) . "";?> Tax:' . Mage::helper("core")->currency($order_details->tax_amount) . "";?> Discount:' . Mage::helper("core")->currency($order_details->discount_amount) . "";?> Amount Paid:' . Mage::helper("core")->currency($order_details->total_paid) . "";?> -
In order to display a custom static CMS block, for example social-buttons-block, use this code:
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: