0

I am getting below error on Select customer step after clicking on Create Order button.

Call to a member function getStore() on a non-object in /app/code

/core/Mage/Sales/Model/Quote/Payment.php

    public function getMethodInstance()
    {
        $method = parent::getMethodInstance();
        return $method->setStore($this->getQuote()->getStore());//Error line
    }

I googled this error and found that if we truncate or delete rows from table sales_flat_quote_payment it works perfectly.

But I can't do this on my live site. Is there any other solution?

4
  • have you updated stores?
    – Abdul
    Oct 29, 2015 at 13:02
  • I have made no change in stores. Please see my updated question for code in which error is coming. Oct 29, 2015 at 13:06
  • Please put below code : public function getMethodInstance() { $method = parent::getMethodInstance(); if($this->getQuote()->getStore()) { return $method->setStore($this->getQuote()->getStore()); }else { return $method->setStore(1); } }
    – Abdul
    Oct 29, 2015 at 13:14
  • Now I am getting same error on line if($this->getQuote()->getStore()) Oct 29, 2015 at 13:28

1 Answer 1

1

Call to a member function getStore() on a non-object

it means there is some issue with $this->getQuote() function and this->getQuote() return non object result might be because of some issue with table

sales_flat_quote_payment

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.