Good day, dear visitors of our site, today let's talk about how to install the module to which you are accustomed and which has successfully worked for opencart 1.5.x. the second version of Opencart 2.x.
From the release of the second branch opencart many webmasters are faced with such a problem as the adaptation of the modules under its previous versions 1.5.x.
All we know that the second version of opencart radically changed and is not similar to the previous one, although some units of the first branch is still work fine on a two-man team though few and most of them need to adapt and change.
Today I would like to describe here a part of the major changes that have been affected, and to be applied in the adaptation of a specific module.
In fact, the adaptation of the module is not that already a difficult task if you understand what to do, and with simple modules are not great you can handle yourself.
Just want to draw your attention to the fact that the second branch longer uses VQMOD, but instead used OCMOD, the principle it is the same and has the same syntax, but if you want you can still connect the same VQMOD, especially because most software hurry to alter their modules under OCMOD continue to write them on VQMOD.
And so for the adaptation module Opencart 1.5.x under Opencart 2.x you need to consider the following differences:
1. Now, instead of:
1 |
$this->data |
We should simply write:
1 |
$data |
2. Instead:
1 |
$this->template = 'module/module.tpl'; |
Now will be:
1 |
$this->response->setOutput($this->load->view('module/module', $data)); |
3. Also, instead of:
1 |
$this->render() |
Now, we write:
1 |
$this->load->view('catalog/category_list.tpl', $data); |
4. Instead of this:
1 2 3 4 |
$this->children = array( 'common/header', 'common/footer' ); |
Now it is:
1 2 3 |
$data['header'] = $this->load->controller('common/header'); $data['column_left'] = $this->load->controller('common/column_left'); $data['footer'] = $this->load->controller('common/footer'); |
5. Oh and instead redirect:
1 |
$this->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL')); |
Now used:
1 |
$this->response->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL')); |
It's certainly not all the differences and changes but only a few of them, but knowing these differences you will already know which way to move on, just forgot to point out that the second version uses bootstrap and all the modules needed as well adapted to it.
General try, test, and you will succeed.
No Comment
You can post first response comment.