Answer the question
In order to leave comments, you need to log in
How to properly develop modules for OpenCart?
Hello! The third day I'm picking opencart, I tried to write a simple module for displaying informers in a template, and everything seems to work out.
I didn't find any good documentation on modules.... And here's what I'm interested in: Is it necessary to create a table in the database for each module? Can I link my table to opencart tables? Do I need to write my own validation or is it out of the box?
Gentlemen, if you don't mind explaining how to competently approach the development of modules (for example, some kind of news block)?
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
opencart modules don't use their own tables by default. At least 3 files per frontend and backend: language, view, controller. By default, "modules that come with the assembly" are stored in json directly in the controller and are sent to the shelf line of the system table. The standard validation for the standard module is done in the same place - in the controller.
You can use any models in the module, and those that already exist and write your own.
It all depends on how complex the module you want to implement.
News block?
Are you talking about a module or a component?
The component is written similarly, not all components need their own tables and models.
Called by link: index.php?route="controller folder/controller name/action
The action called by default is index
Opencart - very simple cms/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question