Magento

How Magento 2 get Order Data on Success Page?

Written by Chirag Parmar

May 31

How Magento 2 get Order Data on Success Page?

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

<?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

<?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>

Written by Chirag Parmar

Our Magento Store

Do not miss a chance to grab exciting offers on Magento Development at Dolphin Web Solution. We are providing discounts on various Magento services this season. Go and grab yours today at our Magento Store.

Multiple Wishlist for Magento 2

Multiple Wishlist for Magento 2

₹ 3106

Wallet and Reward Points for Magento 2

Wallet and Reward Points for Magento 2

₹ 9476

RMA for Magento 2

RMA for Magento 2

₹ 11865

₹ 14254
Abandoned Cart Email for Magento 2

Abandoned Cart Email for Magento 2

₹ 6291

Simple Details on Configurable Product for Magento 2

Simple Details on Configurable Product for Magento 2

₹ 7883

₹ 9476
Frequently Bought Together for Magento 2

Frequently Bought Together for Magento 2

₹ 5494

₹ 7087

Let's Start Your Project

Get free consultation for your digital product idea to turn it into reality!

Copyright © 2023 DOLPHIN WEB SOLUTION. All rights reserved.

TO TOP