You can get order data by order increment id by programmatically from below code snippet,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | protected $_order; protected $_orderFactory; public function __construct( \Magento\Sales\Model\OrderFactory $orderFactory, ){ $this->orderFactory = $orderFactory; } /** *@param int $id The order Increment ID. */ public function getOrderByIncrementId($incrementId) { $this->_order = $this->_orderFactory->create(); if ($incrementId) { $this->_order->loadByIncrementId($incrementId); } return $this->_order; } |
Call in template file as below way,
1 2 3 4 5 | $incrementId = '000000001'; $orderData = $this->getOrderByIncrementId($incrementId); foreach($orderData as $order) { echo "<pre>";print_r($order->debug()); } |
The result will be given order data of specific order increment id.