Blog

Making changes in Magento’s core functionality without touching its core

Table of Contents

Magento handles its data in a specific way as per the models and modules in its functionality. Sometimes there might be a need to change the way this data is handled or displayed for any reason or scenario whatsoever. Changing the Magento’s core directly is a bad practice in such cases because these changes made in the core would seize to exist when the Magento is upgraded and all the changes would be lost for further use.

Certain ways to change Magento’s core functionality without altering the files in its core folder are:

‘Plugins’ are the best way to make changes in Magento functionality. Although in some cases these Magento Plugins do not prove to be useful, hence in such cases we use ‘Events and Observers’. In the scenarios where both Plugins and Events and Observers fail to solve the purpose, ‘Preferences’ are used.

Plugins

Plugins were introduced in Magento 2 and did not exist in Magento 1. Plugins can be utilized for all classes but only for changing public methods. Protected and private methods cannot be modified using Plugins. There are three types of Magento Plugins which are provided in Magento and they are:

Events and observers

Events and observers are a way to intercept Magento’s flow by observing the events that the Magento triggers. Observers are hooked to events in the Magento Functionality, for example, customer login. These can be used to do changes in such events, like, we can write a function for shooting an e-mail to the customer each time they log in, etc.

Preferences

Preferences in Magento 2 are similar to the rewrites in Magento 1. Preferences are used to substitute an instance of a class with another instance. It is basically used to call a substitute class instead of the original class asked for. This substitute class is the one where all the changes in functionality are done without changing anything in the original class.

Watch the video to learn how to use each of the above methods to make changes to Magento technology without disrupting the authenticity of the Magento core.

Joy

Codilar Technologies

Picture of Arijit Panigrahi

Arijit Panigrahi

I am experienced in Magento development specialising in PHP, HTML, jQuery, and PWA projects with expertise in GraphQL, algorithm design, and database design, I have delivered high-quality solutions for diverse clients. I am experienced in algorithm design, optimizing application performance, and database efficiency. With a commitment to professionalism and a passion for continuous learning, remain at the forefront of web development innovation.

You May Also Like

Latest Blogs

Magento Development Company

Let’s talk

Our Offices

DTECH, Techno Hub 1, Dubai Silicon Oasis Authority, United Arab Emirates – Dubai – United Arab Emirates

Singapore

Codilar Digital Pte Ltd, 68 Circular Road, #02-01, 049422, Singapore

India

Bengaluru

7th Floor, Jupiter Block ,Prestige Tech Park, Kadubeesanahalli, Bellandur Amanikere, Bengaluru, Karnataka 560103

Calicut

SBC No 4 & 6 upper basement, Sahya Building
KSITIL SEZ, Cyberpark Kozhikode Park Rd, Nellikkode, Kozhikode, Kerala 673016

Kolkata

Astra Towers, ANO -523 ,North Block, Action Area IIC, Newtown, Kolkata, West Bengal 700135

Ahmedabad

Codilar Technologies, Connekt, 13th Floor, Gala Empire, Opposite T.V. Tower, Drive In Rd, Memnagar, Ahmedabad, Gujarat – 380052

Oman

Building No. 2/796, Way No. 43, Block No. 336, Al Khud 132, Muscat, Oman

Codilar

© Copyright Codilar 2025. All Rights Reserved. Privacy Policy

Send Feedback

Request PWA Demo