Categories

Featured templates

OpenCart 2.x. How to deal with “Fatal error: Call to a member function getModule()” error after activating “Maintenance Mode”

Rating: 5.0/5. From 1 vote.
Please wait...

This tutorial will show you how to deal with Fatal error: Call to a member function getModule()’ error after activating ‘Maintenance Mode in OpenCart.

OpenCart 2.x. How to deal with “Fatal error: Call to a member function getModule()” error after activating “Maintenance Mode”

The error usually looks like this:

OpenCart_2_How_to_deal_with_Fatal_error_Call_to_a_member_function_getModule_error_after_activating_Maintenance_Mode_1

Let’s see how to fix it:

  1. Open the file catalog/controller/common/header_center.php.

  2. Locate the line:

    $this->load->model('design/layout');
  3. Add the following code right after that line:

    $data['maintenance'] = $this->config->get('config_maintenance');
  4. 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);
    			}
    			}
    		
  5. 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);
    			}
    			}
    			}
    		
  6. Save the changes. Log out from your Opencart dashboard, clear browser cache to see the changes:

    OpenCart_2_How_to_deal_with_Fatal_error_Call_to_a_member_function_getModule_error_after_activating_Maintenance_Mode_2

Feel free to check the detailed video tutorial below:

OpenCart 2.x. How to deal with “Fatal error: Call to a member function getModule()” error after activating “Maintenance Mode”

OpenCart Responsive Themes
This entry was posted in OpenCart Tutorials and tagged error, fatal, function, getModule, maintenance, mode, opencart. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket