Magento 2: Override/Rewrite Block, Model, Controller, Helper using Plugin & Preference

This article shows how you can override / rewrite Block, Controller, Model, and Helper in Magento 2. This can be done by two ways: 1) using Preference 2) using Plugin Preference is similar to class rewrite in Magento 1. There is always possibility of conflict when two or more custom modules try to rewrite/override same … Read more

Magento: Avoid Module/Extension Rewrite/Override Class Conflict

While developing Magento modules/extensions, we often come up with a case where our module and some other module are rewriting/overriding the same core class. Hence, we get a conflict here and either our module or the other module will not function as expected. There are some ways to avoid such conflicts. I will explain about … Read more

Magento: Overriding Template File from Custom Module

Scenario: I have created a new custom module. Now, I need to edit a default template file. For example:- – I have created a new custom module that adds some functionality to Customer Account section on frontend. – Now, I need to edit the Customer Account Edit template (My Account -> Account Information). – This … Read more

Magento: Rewrite/Override Block Controller Model Helper

This article will show how you can override/rewrite Magento Block, Controller, Model and Helper files. We will be dealing with the config XML files and the class files to override. We override Magento core classes to update/modify the core functionalities according to our need. We can directly makes changes in the core Magento classes but … Read more

Magento: Admin Controller Override

I had to override adminhtml controller class (Mage_Adminhtml_System_ConfigController) with my module’s controller class (MyNamespace_MyModule_ConfigController). It was really tough to find the right solution. I googled, searched in magentocommerce forum and found a lot of solutions. But they didn’t work for me. After searching & trying more, I got some work done with the following piece … Read more