Magento Modules Structure

Magento is an object-oriented php framework that can be used to develop modern, dynamic web applications that tap into Magento’s powerful e-commerce features. In Magento the code is organised in individual modules. Magento’s files are grouped on the basis of the functionality unlike in typical php MVC application where all the controllers are in one folder and the models are in another folder. this makes easy to override the functionality in the Magento and extend the functionality according to the need. The Magento Modules Structure is as follows

You will find the Controllers, Models, Helpers, Blocks, etc. related to Magento’s checkout functionality in “app/code/core/Mage/Checkout”

Magento's Modules Folder Structure

Magento’s Modules Folder Structure

If you want to customize or extend Magento, rather than editing core files directly, you can place your new Controllers, Models, Helpers, Blocks, etc. next to Magento code, you have to create your own Modules in “app/code/local/Package/Modulename”

Folder for New Modules

Folder for New Modules

Where package (also referred as namespace) is the unique name that identifies you company or organisation. after creating the module you need to create a xml file in app/etc/modules to tell Magento about your module. The name of the xml file will have the naming convention as Packagename_Modulename.xml. There is one more file which has the naming convention as Packagename_All.xml which is used to activate several modules through one file.

Configuration Files

Configuration Files

This is the brief introduction to the Magento Modules structure. In the next post we will discuss about the URL structure of the Magento.

Rajat Jain
Rajat Jain

Latest posts by Rajat Jain (see all)

Leave a Reply