To explore the code of defualt featured module, let’s start with listing what files are used by the Featured module:

Admin folder files:

Catalog folder files:

How to know which files are used by module?

Always look to the url. For Featured module, go to Admin >> Extensions >> Extensions >> Choose “Modules” from the dropdown. Then find the “Featured” and then click blue Add button (if the module is already installed nor you have to install the module and click the blue button). You will see url like below:

http://localhost/opencart2302/admin/index.php?route=extension/module/featured&token=LMEWZBoKMxfr1D7s2dhYe5niRfOAz0Ak

See the value of route, here route=extension/module/featured, as this is in admin so your token value may be different.

While seeing for the files always start from the route, route give you controller file and inside controller we can find the language file, model file and template file.

Now as per the route value go to admin folder >> controller folder >> extension folder >> module folder >> and find featured.php file.

Like this  way you can find the controller file, controller file end with .php extension. From controller file you can find the language file used by that controller with lines of code as

$this->load->language('extension/module/featured');

It means that admin >> language >> LANGUAGE folder >> extension folder >> module folder  >> featured.php

Like that you can find the language file, language file ends with .php extension.

To find the view file find code that start with $this->response->setOutput. In featured module it is like below:

$this->response->setOutput($this->load->view('extension/module/featured', $data));

It means that admin >> view >> extension folder >> module folder >> featured.tpl

Like this way you can find the view file, view files ends with .tpl extension.

LEAVE A REPLY

Please enter your comment!
Please enter your name here