How to Customize Footer In WordPress?
While designing a website the entire page matters. That includes the…[...]
You will receive quote within 24 Hrs
Magento is arguably one of the most popular open source ecommerce software around today. Magento comes in three different flavors:
Magento is a very versatile platform with the basic installation providing loads of useful features. One of the main reasons that Magento has grown so popular is the fact it has lots of different features in built. Besides which it is also possible to install one of the many free and paid modules that are available online. But sometimes even that is not enough if you wish to customise the website to meet the client’s requirements. In such cases you need to make a module of our own and install it. Since Magento is built using PHP, you will need some programming knowledge and be aware about the PHP language to be able to customize the website and make a module.
Alakmalak is a company that offers the service of Magento Development. This is one company that has been involved in more than 2000 web development projects for clients from all around the world. Their skill full Magento Web Developers are more than capable to develop the right website for your business.
To start with create a new file by the name DP_FirstModule.xml and enter the code mentioned below in the file:
This file does the job declaring the module and letting your Magento website know that there is a new module. It needs to be uploaded to the your Magento installation in the following directory:
Magento follows the popular pattern of MVC. For those who are not familiar with this abbreviation, MVC stands for Module, View, Controller. Thus each section of Magento, especially the functionality is divided into many different modules and each section consists of a file for the module code, the view code and the controller code. We will now create a controller class and name it IndexController.php with the following code:
class DP_FirstModule_IndexController extends Mage_Core_Controller_Front_Action
public function indexAction()
You will need to create several directories before uploading this file and adding it to your Magento installation. Follow the instructions mentioned here:
The next step involves creating yet another file and this one is called FirstModule.php with the following code:
class DP_FirstModule_Block_FirstModule extends Mage_Core_Block_Template
// necessary methods
This file requires you to make a new directory, but just one this time. Use any software like FTP to drill down to the new directory that you have already created app/code/local/DP/FirstModule and create a new directory called ‘Block’ and then upload the file you just created there. Thus after you have done so you will have something that looks like this:
There is one more file that is required to completed the configuration of the new Magento module. This is an XML file called config.xml with the following code:
</ dp_firstmodule >
The last set of files that needs to be created is firstmodule.xml and firstmodule.phtml. Since this is a template and to do with the layout of the module and not the code it is located in a different section of the codebase. Here too you will need to make a few new directories by following the instructions mentioned below:
<block type=”firstmodule/firstmodle” name=”hello” template=”firstmodule/firstmodule.phtml”/>
The code for the file firstmodule.phtml is listed below:
<h2>This is my first module, made for Magento.</h2>
This file needs to be uploaded to the directory app/desgin/frontend/DP/default/template/firstmodule/firstmodule/phtml
Thus as you should have guessed by now you will first need to drill down to the directory app/design/frontend/DP/default and then create two new directories template and firstmodule prior to uploading the file.
This is the end of the short tutorial and we have successfully created a module for out Magento Website. But how do we test it. You can do so by simply loading the module in your browser. For example I have been working on a Magneto project installed on my local machine in the directory magento, hence the URL for me will be http://localhost/magento/index.php/firstmodule
If you have installed your Magento files on a server online then you will need to replace the text like ‘localhost/magento’ with the name of your domain.
I want to thank all Alakmalak team for take my project and help me to improve my website! Thank you for your responsibility and seriousness at the time to do corrections and improvements on my website and for always be in touch with me. Highly recommended! Great team! Great company! I'm very thankful Alakmalak!
A few kinds words to say about Alakmalak programming and design. Working with these guys is always such a great relief. You know you are getting your stuff done right and usually always in a timely fashion. I’m a middle man for the most part And my clients are always happy with the end result.