Tony's Blog

Magento 2 how to get Order ID in the custom module

  1. protected $view;
  2. public function __construct(
  3. \Magento\Sales\Block\Adminhtml\Order\View $view
  4. )
  5. {
  6. $this->view = $view;
  7. }
  8. public function Yourfunction(){
  9. $orderIds = $this->view->getOrderId();
  10. }