- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
OpenCart 2.x. How to deal with “Fatal error: Call to a member function getModule()” error after activating “Maintenance Mode”
June 30, 2015
This tutorial will show you how to deal with ‘Fatal error: Call to a member function getModule()’ error after activating ‘Maintenance Mode’ in OpenCart.
The error usually looks like this:
Let’s see how to fix it:
-
Open the file catalog/controller/common/header_center.php.
-
Locate the line:
$this->load->model('design/layout');
-
Add the following code right after that line:
$data['maintenance'] = $this->config->get('config_maintenance');
-
Locate the following lines:
if (isset($part[1])) { $setting_info = $this->model_extension_module->getModule($part[1]); if ($setting_info && $setting_info['status']) { $data['modules'][] = $this->load->controller('module/' . $part[0], $setting_info); } }
-
Replace them with:
if ($data['maintenance'] == 0){ if (isset($part[1])) { $setting_info = $this->model_extension_module->getModule($part[1]); if ($setting_info && $setting_info['status']) { $data['modules'][] = $this->load->controller('module/' . $part[0], $setting_info); } } }
-
Save the changes. Log out from your Opencart dashboard, clear browser cache to see the changes:
Feel free to check the detailed video tutorial below: