Skip to main content

Custom Magento Module tutorial and ModuleCreator

Creating custom Magento module is a little bit tricky and tough, especially if you are going with the manual approach and creating every class and setting up every XML file. Because creating a simple Magento module requires lots of coding and configuration. In some scenario, if you will type the XML node in the wrong case(i.e lower case or upper) then also it will not work. This is the main reason developer hesitate to work on Magento and sometimes they believe that the Magento is very complex. But if you will learn the internal architecture of the Magento and you will have some template or sample module to start your work, you will really enjoy developing Magento module. In my custom Magento module tutorial, I will demonstrate how to create Magento module and be using a template module of the Magento(official name ModuleCreator) and also will demonstrate the complete structure so that creation of the Magento module will be easier for you.

Step -1 Create Module Using Magento ModuleCreator

Magento Module Creator is itself a Magento module which can create a skeleton or you can say blank Magento module for you. By creating the module using module creator your work will be minimized by 50%. After creation of the module using module creator, you only need to understand the flow of the Magento and a little bit of the MVC framework to finish your job. You can download ModuleCreator from Magento Connect website(Thanks to Netz98). But the module supported for version 1.3 only and the current version of Magento is 1.7 on which ModuleCreator is not supported, very sad new. But no need to worry I have made some modification in the existing ModuleCreator and it is working absolutely fine. You can download the modified version of the moduleCreator by clicking here.

If you have installed the module using Magento connect then you need to open the URL [yourmagentowebsite]/moduleCreator. If you have downloaded moduleCreator from my website unzip the file and place unzip the folder in your Magento website installation and open URL [yourmagentowebsite]/moduleCreator. In my case it is . Once you will enter this URL you will find a login page. Following is the snapshot.Magento ModuleCreator login

Please enter your Magento login username and password to enter into moduleCreator. Once you will enter the correct username and password you will get the interface where you need to enter information to create your own new custom module. Following is the screenshot of the page where you need to enter information to create your own custom module.

Magento Module Creator Post login snapIf you are new to Magento Let me explain that all the input required by moduleCreator for you.
Namespace: In Magento module creation namespace is the container above the module. I will explain this in the latter part of this tutorial. Type your company name here like techflirt.
Module: This is the name of your module.
Magento Root Directory: It is the root directory of the Magento. It will be auto-populated by the module. If not then please enter the correct path of your Magento installation root.
Leave Design field empty.

Click on Create button and you will see the location of your module and module related file. Below is the snapshot.Module Creation Final StepCongratulation!!! Your new module has been created. You can see the list of the location of the file created by modulecreator for you. You can login into your Magento’s admin panel and see that a toolbar by your module has been created like below.

Magnto Admin Menu

Let us move to step 2 where we will explore on how to create a new functionality in the Magento module and the structure of Magento module.

Step – 2 Customizing your new Module(Adding New feature)

In step 1 you have created the blank module. Now it is time extend the feature of the Magento using the blank skeleton. you can go to YourMagntoInstallation/app/code/local/techflirt/helloworld directory and see all basic required directory and files has been created. Also, it has created a table in the sample database. If you have some basic knowledge of the Magento module structure you can easily go on next step. If you have no idea about the Magento module structure please read my next posting on Magento Module Structure.

Have a nice coding ahead.

Support Me by Sharing This Article

Ankur Kumar Singh

I am a PHP programmer having some knowledge about Linux. I am always interested in web development and knowledge sharing. I am full time tech evangelist part time human being. :-)

Leave a comment/Ask Question

15 thoughts on “Custom Magento Module tutorial and ModuleCreator

  1. wow your modification in module creator is working and i can create module eaisly.
    Please let me know what change you made in the code.

  2. Best help for how to customize magento and if custom module not working in magento 1.7. Also if you are looking for how to install module creator 1.3 in magento 1.7. Also for magento download module creator and magento module creator for 1.7

  3. Thanks you for sharing this tutorial. I’m looking for a way to build my own magento modules and found this article. Great help!

  4. Nice tutorial….
    I got module crearor from magento connect but it has some bugs in compatibility with magento 1.7. I downloaded it from here and replaced the file and it is working fine for me.

    Thank for helping.

  5. Great tutorial.Good Job. just want to update for version 1.9 put layout files in frontend/base/default instead of frontend/default/default.

  6. how can i create a separate module files not installed right way if i empty the
    Magento Root Directory then it gave error Fatal error: Uncaught exception ‘Exception’ with message ‘Warning: unlink(var/cache/) [function.unlink]: