In principle, there is nothing particularly complicated. Here's the manual:
1. You need to add layers in the form of the " extension " directory. It is necessary to lengthen the paths and, accordingly, adjust the code (and then check it again from scratch). And this applies not only to controllers, but also to models, translation, and views. Below is from their documentation.
Regarding the location. What happened:
admin/controller/module/xxx.php
admin/model/module/xxx.php
admin/language/en-gb/module/xxx.php
admin/view/template/module/xxx.tpl
As it is now:
admin/controller/extension/module/xxx.php
admin/model/extension/module/xxx.php
admin/language/en-gb/extension/module/xxx.php
admin/view/template/extension/module/xxx.tpl
Regarding controller and model names, you now need to add Extension . So that ControllerModuleMyModule becomes ControllerExtensionModuleMyModule , and ModelModuleMyModule becomes ModelExtensionModuleMyModule . The same limitation in class names.
Regarding connecting models, now you need to add the prefix "extension/", for example,
$this->load->model('extension/module/MyModule')This is also reflected in the creation of dynamic variables of class objects. That is, instead of model_module_MyModule , now you need to use model_extension_module_MyModule .
This point applies not only to the administrative part “admin”, but also to the main part, i.e. the directory “catalog”.
2. Now summernote must be connected separately. Coping with this task is quite easy. Just add the necessary scripts:
$this->document->addStyle('view/javascript/summernote/summernote.css');
$this->document->addScript('view/javascript/summernote/summernote.min.js');
$this->document->addScript('view/javascript/summernote/opencart.js');
3. Modification of the left menu in the admin panel. Now, the menu in the admin panel is located not at the addresses " controller/common/menu.php " and " view/template/common/menu.tpl ", but at " controller/common/column_left.php " and " view/template/common/ column_left.tpl ". It is worth noting that the menu is now built dynamically in the template according to the controller data, i.e. it is not simply presented as a list of ul-li tags. So those who made manual edits and inserts into the template will have to put it aside and carefully study the controller, namely the structure of individual menu entries.
Of course, there are other issues, but these are probably some of the ones that almost every module faces.














































Comments