The new module system in opencart 2.x

Posted by Flo on 08 Dec 2014

In this article I am reffering to the module system present in opencart 2.0.1.0 and up.

Initially opencart 2.0 came with a changed module system, where you added module instances on the module page but to assign the modules to layouts you had to go on the layouts page , edit a layout and add modules to it (unlike opencart 1.5.x where you also selected the layout and position on the module page). While I like this ideea, on the layouts page it was kind of difficult to identify and remember the module instances you created.

Fortunately the new opencart 2.0.1.x came with a new module system, one that I personally like very much. Now instead of adding module instances on the same page, when you edit the main module you get a single form without an add module button. After you fill in the settings and save, a new module instance is created and displayed in the modules list (at extension > modules) as a new module below the parent(main module).

And now you can set a module title for each added module so you can easily find it and remember its instance purpose.You can think of the main module as a template from which you create actual modules to be used on the layouts.

To output the modules to pages you must go in admin to system > design > layouts , edit the layout you want the module to display on. Click add module and in the new form select the module you created , the position and the sort order.

Now it will be easier to manage the modules on a layout because all modules are added on the same page and you dont need to edit more modules to change a layout's structure.