I have developed a block and placed at order details page, and wanna get the order information but cannot use query_string

I can get the order no. from query_string: $this->getRequest()->getParam('order_id');

For security issue I cannot use this method -> pass by query_string.

So, I try to use $this->getOrder()->getOrderId();

but system retured error:

Fatal error: Call to a member function getOrderId() on null

1 Answer 1


First,You need to check ,the order is exit or not by below code:



getOrderId() is not right method to get order id


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.