Magento custom module is a primary part of Magento project. This is necessary especially if you want to integrate your own custom extension or Wordpress multiple themes in the development. If you want to start building your Magento custom extension, here’s a tutorial that covers the Magento custom extension development or you can hire a professional Magento extension developer. Similar to CakePHP, Joomla, and Codelgniter, Magento extension development also uses the MVC-based architecture.
Let us assume that you have installed your Magento:
- Name your extension
You can now name your extension. Your module name should show this format: <Namespace>_<Module>. Web developers suggest in setting the author or company name in the <Namespace> and the actual module name in the <Module>.
If you have set the name for your Magento Custom Extension, it’s time to develop you custom extension. The module configuration file informs Magento about your new module including the number of files, types of file, and more.
- Disable the cache
Moreover, make sure that you already disable the cache. To disable, follow below steps.
- Go to Magento Admin Panel
- Choose System
- Select Cache Management
- Check all the cache type
- Select the disable cache
- Then click submit
Go to app/code/local/Chiragdodia/Mymodule/etc and build your config.xml with the following content:
<version>0.1.0</version> <!– Version number of your module –>
- Tag descriptions
To understand each tag, we described each below.
The first tag is your module. It contains the name and version number, which is imperative in updating your module.
The <frontend> informs Magento of the controller dispatched. The <routers>, found in the <frontend> tag informs Magento the process to access the controllers through the routing mechanism.
You can access your extension in the front end as yoursitename.com/index.php/mymodule/index using the frontend name.
When you call your site yoursitename.com/index.php/mymodule/index or yoursitename.com/index.php/mymodule, Magento will find for index action of your extensions controller file. This requires you to create your controller life.
- Create the controller life
To create the controller life, visit app/code/local/Chiragdodia/Mymodule/controllers and build file IndexController.php using below codes:
class Chiragdodia_Mymodule_IndexController extends Mage_Core_Controller_Front_Action
public function indexAction()
echo “Hello tuts+ World”;
Just a quick tip, the class name and file name are case sensitive so take care of using uppercases and lowercases in naming your classes and files.
You can now open your URL yoursite.com/index.php/mymodule/index and it will show you your first hello world module.
Building an online shop powered by Magento requires a lot of work especially if are doing this the first time. A professional Magento custom extension developer can make the process smoothly.
If you want to learn developing Magneto extension, the above steps will help jumpstart your learning curve. It may take a while especially if you are new to coding, but you will gradually familiarize the process once you go through.