D
D
dj_maestro2017-04-21 14:51:56
opencart
dj_maestro, 2017-04-21 14:51:56

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

1 answer(s)
T
tester_toster, 2017-04-21
@dj_maestro

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 question

Ask a Question

731 491 924 answers to any question