Opencart Module Structure Part 1

Opencart used MVC(L) Architecture(Model–view–controller (MVC) is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates “domain logic” (the application logic for the user) from the user interface (input and presentation), permitting independent development, testing and maintenance of each (separation of concerns). From


But there are many were change.

In directory that you installed Opencart there 2 folders that important.


Modules must be store in they , but there is some module store in catalog/ only ex. contact,sitemap.

Ok i will explane abuot a contact module.

Module structure:

catalog/language/(eng | ….)/information/contact.php.(L)
catalog/view/theme/(default | …)/template/information/contact.tpl.(V)

Contact controller will load contact language and sen output(render) to contact.tpl

If you need to store contact lists to database???

You need to create the Model(M) for connect to your database.


catalog/model/information/contact.php(New file).

In this file should be php code.

class ModelInformationContact extends Model {




End Part 1 Part 2 comming soon.

Don't be shellfish...Share on FacebookTweet about this on TwitterShare on Google+Digg thisPin on PinterestShare on Reddit
Post Tagged with , ,


อีเมลของคุณจะไม่แสดงให้คนอื่นเห็น ช่องที่ต้องการถูกทำเครื่องหมาย *

คุณอาจจะใช้ป้ายกำกับและคุณสมบัติHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>