I'm trying to list my newly created module(account_test)
that copied from "account"
module in OpenCart 2.x (account
module shows in backend system->design->layouts-> edit home layout
). I have duplicated all account php & tpl files to account_test & tpl files and change all references from account
to account_test
in both admin & catalog
module/language/view
folders.
Also, I noticed in admin\controller\design\layout.php
the if statement which add only Account & Category
modules to Layouts setting:
if ($this->config->has($code . '_status') || $module_data) {
$data['extensions'][] = array(
'name' => $this->language->get('heading_title'),
'code' => $code,
'module' => $module_data
);
}
If i remove the if condition :
$data['extensions'][] = array(
'name' => $this->language->get('heading_title'),
'code' => $code,
'module' => $module_data
);
It will add all modules to layouts view, but none of them working except old modules
Stuck in this for few days, Any ideas to list newly created module to layouts admin section and front end?
Is you module get installed or not? If you followed correctly then it must be listed in
admin->extension->modules
. And then from there you have to first install it and then enable it. And also make sure the controller file named properly.Edit
$this->config->has($code . '_status')
checks whether you module is installed or not i.e. is it in setting table or not. Check in setting table for your module code.