By default, Magento show thank you message and quick order id on the order success page. Some customers have custom requirements for edit success page content and show order information in detail or pass this data to google analytics. In this blog, I will show you how to get order information on the success page and use order data for various prospects.
There are 2 ways to get Order Detail in Success page :
We can get order data on the Magento 2 success page by following way :
1) By overriding success block
2) By Object Manager (Not Recommended)
1) Register your module at Path :- Dolphin/Ordersuccess/registration.php
1 2 3 4 5 6 |
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Dolphin_Ordersuccess', __DIR__ ); |
2) Create module.xml file at Path:- Dolphin/InvoicePdf/etc/module.xml
1 2 3 4 |
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Dolphin_Ordersuccess" setup_version="0.0.1" /> </config> |