2

I am getting the below error while opening/viewing admin -> sales -> order -> view.

Call to a member function getMethodInstance() on boolean in /var/www/magento/app/code/core/Mage/Payment/Model/Observer.php on line 46

This error is causing for orders, those are having the order total is Zero means No Payment Information Required.

We are using Magento ver. 1.13.1.0.

Any help would be appreciated.

  • have you done any customization for payments or add any custom extension for the payment or shipping methods? – Abdul Dec 19 '16 at 10:37
  • @ Abdul thanks for reply, We have not done any customization or modifications related to payment gateway. – Krishna ijjada Dec 19 '16 at 10:39
  • have you added any custom extention? – Abdul Dec 19 '16 at 10:40
  • Yes we have added one extra column to sales order grid. – Krishna ijjada Dec 19 '16 at 10:45
  • Pls comment your code and check again. I think working :) – Abdul Dec 19 '16 at 10:48
2

Replace your code

From

protected function _prepareCollection() 
{ 

$collection = Mage::getResourceModel($this->_getCollectionClass()); 

$collection->getSelect()->join(array('billing'=>'sales_flat_order_address'),'main_table.entity_id=billing.parent_id and billing.address_type="billing"',array('*')); 


$this->setCollection($collection); 
return Mage_Adminhtml_Block_Widget_Grid::_prepareCollection(); 


}

To

protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $collection->getSelect()->join('sales_flat_order_address', 'main_table.entity_id = sales_flat_order_address.parent_id' ,array('company'=> 'company'));
        $collection->addFieldToFilter('sales_flat_order_address.address_type', array('eq' => 'billing'));

        $this->setCollection($collection);
        return parent::_prepareCollection();
    }
| improve this answer | |
  • @Abdul It will be greate if you can explain about the fix – ImranSheik Dec 19 '16 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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