I installed magento patches(7405,8788,6788) to site,after that when clicking on admin sales > order >view getting error like

   Fatal error: Call to a member function getMethodInstance() on boolean in /var/www/html/rmcstore/app/code/core/Mage/Sales/Model/Order.php

how to solve this

  • Can u share the last part of the code before the error Mar 10, 2017 at 5:56
  • not getting @karthik
    – User0434
    Mar 10, 2017 at 6:00
  • when you got the error you must have changed something in code , i assume before you made change the code must be working jus remove the patch and check Mar 10, 2017 at 6:01
  • i installed magento patches after that it will not come i think,i didnt change any code
    – User0434
    Mar 10, 2017 at 6:03

1 Answer 1


Even with very little PHP knowledge, you can always diagnose issues thanks to Magento's error reporting mechanism.

This error indicates the exact file & line of code which are responsible for it, so take the following steps:

  1. Navigate through app/code/core/Mage/Payment/Model/ & open Observer.php,
  2. Scroll to line 46

The line of code in 1.7 reads as follows:

if ($order->getPayment()->getMethodInstance()->getCode() != 'free') {

Now, the error message also tells you that the following code is what is causing the issue:

Call to a member function getMethodInstance()

So after you read the line of code on line 46, you'll see that that method is applied to the $order object, this is defined just above line 46 (on line 44):

$order = $observer->getEvent()->getOrder();
  • so how to resolve this @calypso
    – User0434
    Mar 10, 2017 at 6:06

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.