OpenCart is an e-commerce cart application built with its own in-house framework, which uses the MVCL pattern. Thus, each module in OpenCart also follows the MVCL pattern. The controller creates logic and gathers data from the model. It passes this data to display it in the View. In this chapter, we will deal with the following topics:
Creating a
Hello World
module.Defining OpenCart modules
admin
andcatalog
folders and file code in theadmin
folder helps control the setting of the module, and files in thecatalog
folder handle the presentation layer (frontend).Each module has its own files, because of which it becomes modular, and changing one module's file does not affect other modules. In OpenCart 2, we can create multiple instances of one module and have a dynamic module name. Modules do not hold the layout; rather, the layout holds the modules, which are made more modular.
With one module, we can create many modules and show them as different...