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.
We can get order data on the Magento 2 success page by following way :
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Dolphin_Ordersuccess', __DIR__ );
<?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>