MAGENTO 1.X – CREATE A CUSTOM HELPER


We are going to assume that you have a local extension working under app/code/local/Offset101/Helpertest, so, we will proceed adding our helper, as follows:

  • Add the below in within the global tag in app/code/local/Offset101/Helpertest/etc/config.xml:
  • Create a file under app/code/local/Offset101/Helpertest/Helper/Data.php that will be as a generic helper method:
  • Create a file app/code/local/Offset101/Helpertest/Helper/Calculator.php made for particular methods helper:
  • Right now your helper is done, you can call it from wherever you want on Magento such as Controllers, Models, Template files, etc. You can do so, like the below example: