Get Order Information From Order ID in Magento 2 (Updated 2020)

In this code snippet, we will see how to fetch order information such as order items, payment, customer, billing, and shipping details from order id. You can get order id at the checkout success page from the checkout session object.

Get Order Information From Order ID using Repository

Magento 2 recommended using Repository to get the entity data. Below is the code snippet to get order information from the order id using the order repository.

Note: For the demonstrated purpose we have used Objectmanager.Codextblog never recommend the direct use of ObjectManager.One should always use a constructor method to instant an object.

Get Order Items Information

Get Order Payment Information

Get Order Customer Information

Get Order Shipping And Billing Information

Default image
Sagar Doshi
CEO / Managing Partner

An expert in his field, Sagar Doshi is the CEO and team leader in

meghrajtechnosoft.

His passion for Magento has inspired others in the team too. Apart from work, he is a cricket lover."

Articles: 26

Leave a Reply