Page 1 of 1
[SOLVED] PHP Error in Opencart 2.0
Posted: Thu Nov 06, 2014 3:54 am
by tomd
Hi... I have a clean install of Opencart 2.0. I installed a theme and now the homepage is blank. The error log says:
PHP Notice: Error: Could not load model /public_html/myshop/catalog/model/setting/extension.php! in /public_html/myshop/system/engine/loader.php on line 24
On checking, in OC2.0 extension.php does not exists in catalog/model/setting/ but it has a new extension folder which contains the php file catalog/model/extension/extension.php
The code in loader which seems to be the culprit is:
Code: Select all
public function model($model) {
$file = DIR_APPLICATION . 'model/' . $model . '.php';
$class = 'Model' . preg_replace('/[^a-zA-Z0-9]/', '', $model);
if (file_exists($file)) {
include_once($file);
$this->registry->set('model_' . str_replace('/', '_', $model), new $class($this->registry));
} else {
trigger_error('Error: Could not load model ' . $file . '!');
exit();
}
I am not sure how to fix this as I am very new to PHP and OC. Can someone please help me resolve this issue. I would greatly appreciate it.
There is also another error:
PHP Notice: Undefined variable: text_edit in /public_html/myshop/admin/view/template/setting/setting.tpl on line 29
Edit: I fixed the text_edit error by following the fix in this post:
http://forum.opencart.com/viewtopic.php ... it#p520305
Thanks,
Tom
SOLVED: PHP Error in Opencart 2.0
Posted: Thu Nov 06, 2014 5:39 am
by tomd
Hi All,
Just FYI, I resolved this issue. The theme I was using mentioned that it was OC 2.0 compatible but it had a bug. It was looking for the extension.php in the catalog/model/settings/ folder (which is true in the earlier versions of OC) but in OC2.0 the extension.php is in catalog/model/extension/ folder.
Found this:
Code: Select all
$this->load->model('settings/extension');
$extensions = $this->model_settings_extension->getExtensions('module');
and changed it to:
Code: Select all
$this->load->model('extension/extension');
$extensions = $this->model_extension_extension->getExtensions('module');
I felt helpless as there was zero support from the paid theme maker.
Thanks,
Tom
Re: SOLVED: PHP Error in Opencart 2.0
Posted: Thu Nov 06, 2014 7:13 am
by budgetneon
I felt helpless as there was zero support from the paid theme maker.
The type of error you're describing would mean that the theme developer hasn't even tried their theme once on OC 2.x. This isn't some subtle corner case.
That likely means you're just seeing the tip of the iceberg. Probably more issues to come. Try the checkout path and see how that goes.
I would find a new theme developer that at least does cursory testing.
Re: [SOLVED] PHP Error in Opencart 2.0
Posted: Fri Nov 07, 2014 12:39 am
by tomd
Hi budgetneon,
You are absolutely correct. I purchased this expensive theme from a popular theme site. There are more and more similar problems cropping up. I have requested for a refund.
I have one question:
I have some other customized extensions which are currently being upgraded to be compatible to OC 2.0. What would be the best approach, should I first install these extensions and then the themes or the theme should go on first.
Any insight is much appreciated.
Thanks,
Tom
Re: SOLVED: PHP Error in Opencart 2.0
Posted: Fri Feb 06, 2015 5:29 pm
by MikaelSampoerna
tomd wrote:Found this:
Code: Select all
$this->load->model('settings/extension');
$extensions = $this->model_settings_extension->getExtensions('module');
and changed it to:
Code: Select all
$this->load->model('extension/extension');
$extensions = $this->model_extension_extension->getExtensions('module');
Hi Tom,
Which file I need to change to solve this issue?
Many thanks

Re: [SOLVED] PHP Error in Opencart 2.0
Posted: Tue Sep 01, 2015 6:30 pm
by juliocc
Hello, I am having this same issue and don't know in which file I have to make the corrections. Can someone help me please?
Thanks in advance
Screen capture:
http://puu.sh/jW6dH/64ac99e254.png
some additional info:
- No theme installed, it's default opencart
- This happens only when I add a discount coupon for the checkout, on the payment method selection
Re: [SOLVED] PHP Error in Opencart 2.0
Posted: Wed Sep 02, 2015 12:02 am
by limitlessisa
For 2.0.2
catalog/model/extension/extension.php copy folder to catalog/model/settings/
and catalog/model/settings/extension.php edit :
BEFORE:
Code: Select all
class ModelExtensionExtension extends Model {
function getExtensions($type) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "extension WHERE `type` = '" . $this->db->escape($type) . "'");
return $query->rows;
}
}
AFTER:
Code: Select all
class ModelSettingExtension extends Model {
function getExtensions($type) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "extension WHERE `type` = '" . $this->db->escape($type) . "'");
return $query->rows;
}
}
Re: [SOLVED] PHP Error in Opencart 2.0
Posted: Wed Sep 09, 2015 6:34 pm
by juliocc
That did it, problem is solved. Thank you very much for your assistance sir!

Re: [SOLVED] PHP Error in Opencart 2.0
Posted: Mon Dec 07, 2015 4:05 pm
by tieulong143
limitlessisa wrote:For 2.0.2
catalog/model/extension/extension.php copy folder to catalog/model/settings/
and catalog/model/settings/extension.php edit :
BEFORE:
Code: Select all
class ModelExtensionExtension extends Model {
function getExtensions($type) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "extension WHERE `type` = '" . $this->db->escape($type) . "'");
return $query->rows;
}
}
AFTER:
Code: Select all
class ModelSettingExtension extends Model {
function getExtensions($type) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "extension WHERE `type` = '" . $this->db->escape($type) . "'");
return $query->rows;
}
}
"limitless isa" strictly speaking you need to install OS 2.2. Thank limitlessisa
Re: [SOLVED] PHP Error in Opencart 2.0
Posted: Fri May 13, 2016 6:16 am
by selfmadebracelets
OPENCART 2.0
Get error : admin/model/extension/module.php! in myshop/public_html/system/engine/loader.php on line 24 when i try to open the module in admin panel. Have tried to find a solution but don't find it.
Can somebody help me? i'm not using the default template.
Thanks in advance.
best regards
Yoshi
Re: [SOLVED] PHP Error in Opencart 2.0
Posted: Fri May 13, 2016 7:04 pm
by selfmadebracelets
Hi everybody,
Can somebody help me? I can't fix this error :
Could not load model /public_html/admin/model/extension/module.php! in public_html/system/engine/loader.php on line 24.
But i'm using the default theme. I've tried to contact the theme deloveper but they can't help me. Maybe somebody also use
theme ''Megashop'' from scharles202?
http://www.opencart.com/index.php?route ... =37&page=3
Thanks in advance,
Yoshi