How to Manage the Backend Functionality of Your Magento Store?

Helper contains the necessary functions for you; you can call in a helper from anywhere. An example of helper is as below

$helper = Mage::helper(‘monhelper’);

The call can be related to

$helper = Mage::helper(‘monhelper/data’);

Let’s create a helper file
You will need to declare the helper in the config file in your Magento core. Configure your code in the <global> after the </blocks> field


Next, you will need to create the file app/code/local/STTL/Test/Helper/data.php which will contain the function bytwo($ nbr). A number will be used as an argument here. The return value in the output will be the number multiplied by two.Helper will extend the core class Mage_Core_Helper_Abstract

class STTL_Test_Helper_Data extends Mage_Core_Helper_Abstract{
public function bytwo($nbr){
return $nbr*2;

Go to in/app/code/local/STTL/Test/Block/monblock.php and change the function here with the help of the code below

class STTL_Test_Block_Monblock extends Mage_Core_Block_Template
public function methodblock()
$helper = Mage::helper(‘test’);
return ‘2*2 = ‘.$helper->bytwo(2);

Let’s Add a New Field
Let’s say you want to create a plugin that will store information about payment card in the system>configuration.

Let’s add a sidebar <<Cards>> section with a <<cards>> group and a config tab to help store your card numbers

Let’s begin by creating a structure for the project

<?xml version=”1.0″?>
<!– no dependencies –>
<ecard_section translate=”title”>
<title>My Section </title>

Create etc/system.xml and declare the menu here.

<?xml version=”1.0″ ?>
<ecard_tab translate=”label”>
<ecard_section translate=”label”>
<ecard_group translate=”label”>
<comment>Card Configuration</comment>
<ecard_field translate=”label comment”>
<label>Card Number</label>
<comment>a text to help</comment>

With this xml, you can add a tab to System>Configuration and then retrieve the information from the fields


You can test what you have created by creating a controller in controllers/IndexController.php

class STTL_Ecard_IndexController extends Mage_Core_Controller_Front_Action
* To test Ecards functions…
public function indexAction()
echo Mage::getStoreConfig(‘ecard_section/ecard_group/ecard_field’);


Creating a field or a helper will add functionality and new features to your store. You can even customize your store with the help of these fields. Hire Offshore Magento developers to help you create custom fields or helper.

About deeparanganathan