Book Image

OpenCart Theme and Module Development

By : Rupak Nepali
Book Image

OpenCart Theme and Module Development

By: Rupak Nepali

Overview of this book

Table of Contents (13 chapters)
OpenCart Theme and Module Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 4. Getting Started with OpenCart 2 Modules

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 and catalog folders and file code in the admin folder helps control the setting of the module, and files in the catalog 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...