1. Web Development and Mobile App Development Company – AResourcePool
  2. Blog
  3. Magento
  4. 8 easy steps to Develop Custom Module in Magento

24Oct 2016

8 easy steps to Develop Custom Module in Magento

Tags: , , , , , , , , ,

Magento is an open source platform written in PHP . It is basically used in setting up ecommerce store for any business. imilar in this article we will learn how to develop custom module will learnin Magento. Custom module structure is similar in all versions of Magento.

Whenever you do install Magento, you will look the following Magento Directory structure:

Before starting with Module development:

1-Let us assume that you already have a working copy of Magento with version 1.7 or 1.7+

2-Firstly disable the cache.

For disabling the cache go to:

Magento Admin Panel -> System -> Cache Management -> Select all cache type from left side checkboxes -> Select Action: disable from right to drop down > click Submit.

Custom Module Development:

See below, there are listed some easy steps to that will help you to create your own demo module.

STEP: 1 -> Create New Folder inside Magento/app/code/local/ Directory Module namespace name AResourcePool

STEP: 2 -> Create New Folder inside Magento/app/code/local/ AResourcePool Directory Module name Demo

STEP: 3 -> Create New file inside magento/app/etc/Modules/ AResourcePool_Demo.xml

Paste This Code on this file

<?xml version=”1.0″ ?>

<config>

<modules>

< AResourcePool _Demo>

<active>true</active>

<codePool>local</codePool>

</ AResourcePool _Demo>

</modules>

</config>

STEP: 4 -> Please Check your Module registered or not form adminpanel

System-> Configration->ADVANCED->advanced-> Click on Disable Module Output

STEP:5-> Create Directories inside your module link Module/app/code/local/AResourcePool/Demo/

Block

Model -> Product.php

Controllers

Helper

etc -> config.xml

sql

STEP:6-> Create New File “Product.php” inside Model folder on out module

Product.php

class AResourcePool_Demo_Model_Product {

public function sayHello() {

echo ‘Hi this is testing module’;

}

}

STEP: 7-> For Test that your Module is working or not, create a file in your root magento folder like test.php and call your class and function.

<?php

require_once ‘app/Mage.php’;

Mage::app();

$product = new AResourcePool_Demo_Model_Product;

$product->sayHello();

STEP: 8 -> After that run this file on browser like localhost/Magento/test.php
Then display output of your module function.

For Magento Development you can Hire Web Designer India or Magento Developer India at AResourcePool.

Leave Comment

Your email address will not be published. Required fields are marked *