LKM
LKM

Reputation: 2450

Magento "Fatal error: Call to a member function getCode() on boolean"

Because what I found similar is a little different from the path.

Fatal error: Call to a member function getCode() on boolean in /MagentoProject/app/code/core/Mage/Customer/Model/Session.php on line 71

The code that error message says is that line :

    $namespace .= '_' . (Mage::app()->getStore()->getWebsite()->getCode());

How could I solve this? I didn't do anything...

I set the environment

  1. brew install redis
  2. brew install homebrew/php/php56 homebrew/php/php56-mcrypt homebrew/php/php56-opcache homebrew/php/php56-redis
  3. Set virtual host
  4. 'ln -s ../sites-available/linkshops2 .'

Update

The point of error is below function __construct()

public function __construct()
{
    $namespace = 'customer';
    if ($this->getCustomerConfigShare()->isWebsiteScope()) {
        $namespace .= '_' . (Mage::app()->getStore()->getWebsite()->getCode());
    }

$this->init($namespace);
Mage::dispatchEvent('customer_session_init', array('customer_session'=>$this));
}

Upvotes: 0

Views: 3300

Answers (1)

user1455180
user1455180

Reputation: 561

I have this problem too when I use Magento 1.6 from an existing project.

And I created a file "local.xml" before installation under app/etc/ according to local.xml.template in the same folder. It no longer went through the installation progress but the site was successfully loaded.

Upvotes: 0

Related Questions