Basics to create a custom module in magento

1. How to create a module


The first directory we will create is a “namespace.” This can be called anything you like, but the convention is some form of the name of the company or module’s author.
So, create the directory app/code/local/[namespace]

Create the directory app/code/local/[namespace]/[module name].
Module name should be according to functionality of our module.
We should now have the following directory structure for our module. These directory and file names are case-sensitive, so capitalize where appropriate.

  - code
      - local
          - [namespace]
              - [modulename]

2. Configure our module

Next, we will begin to configure our module. The configuration files belong inside our module in a directory named etc.
Now, we will create a simple config.xml file, which contains following code:

<?xml version="1.0" encoding="UTF-8"?>
	<!-- The root node for Magento module configuration -->
	        The module's node contains basic 
	        information about each Magento module
	            This must exactly match the namespace and module's folder
	            names, with directory separators replaced by underscores
	            <!-- The version of our module, starting at 0.0.1 -->
	        </ namespace_modulename >

3. Activating Our Module

The next step is to inform our Magneto installation that our module exists, which we do by creating a new XML file in app/etc/modules.
The name of this XML file can be anything you like but it is preferable that we use like below
Let’s create app/etc/modules/[namespace_modulename].xml with the following content:

<?xml version="1.0" encoding="UTF-8"?>

            <!-- Whether our module is active: true or false -->

            <!-- Which code pool to use: core, community or local -->


Speak Your Mind

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: