Create first Magento 1.x module

This article will help you to build your first full functional Magento module.

Define the module

First step is to define the module and the location of it in the code pool folder /app/etc/modules/<Namespace>_<Module>.xml

<?xml version="1.0"?>





Create Controller

Create the controller in the module folder under the controllers directory.

class <Namespace>_<Module>_IndexController extends Mage_Core_Controller_Front_Action
    public function indexAction()

Controllers (the classes under under the controllers folder ) are not auto loaded in Magento, so you have to include the extended class manually.

Create Configuration XML


You have to define this file to configure and define all resources needed in the module.

You can define into the configuration XML file the routes, blocks, models, translations and others as shown in the following example:

<?xml version="1.0"?>


X-debug installation and configuration

Find few installation references

Few steps for having  x-debug working on your local environment or development:

  1. Download the proper xdebug extension, or you can use xdebug wizard for more information about environement.
  2. An alternative is to install using pecl: pecl install xdebug
  3. Copy binary file to PHP’s extensions folder
  4. Link this binary file in php.ini using this command zend_extension=”/usr/local/php/modules/”
  5. Enable xdebug in php.ini and configure to listen remote conections
    xdebug.remote_port="<the port for XDebug to listen to>" (the default port is 9000)
    xdebug.remote_host=<the host where PhpStorm is running (e.g. localhost)>
    xdebug.profiler_output_dir="<AMP home\tmp>"
  6. You can check if xdebug is configured properly in php info.


Performance fix for EAV module

This module is a performance fix for all community and enterprise versions before Community 1.9 edition.

Since I worked for a store having a very complex products (with a large numbers of attributes and large scale of values), I discovered that Magento has a performance bottleneck on product listing page and product page.

By having a closer look to the class Mage_Eav_Model_Entity_Attribute_Source_Table you can observe that getOptionText method use

 $options = $this->getAllOptions(false);

for getting all records in database and then filter them like this:

  foreach ($options as $item) {
            if ($item['value'] == $value) {
                return $item['label'];

This module will be useful for Magento shops with products with a large numbers of attributes or/and large scale of values.

Download the module here

Simple carousel for Magento e-commerce

Purchase this extension for 75$ here

Manage your content in a simple way is possible with BB Simple Content Carousel.

Check the video for more details and the demo listed below.

  • Magento 1.9.1

User: bb_slider
Password: bb_slider123

  • Magento 1.8.1

User: bb_slider
Password: bb_slider123

Video tutorials

 Product carousel

Day by day any web shop needs is to group products and place them on the frontend in a fancy user interface.