fbpx

Blog

SOFTLOFT / Blog  / Why is it so Important not to Break Magento Core

Why is it so Important not to Break Magento Core

Sometimes it happens that Magento store functionality requires customization, changing or adding new features. And the question is how to implement new functionality without damaging Magento core.

First of all let’s examine the types of possible changes to Magento core:

–  A piece of functionality in a core should be modified. In this case the decision is to copy the PHP files containing the code and to change necessary methods.

–  The task is to add a new method to a core block class. In this situation it’s available to use the PHTML template to copy the core PHP file and to add a new method to it.

–  The third possible option is the necessity of several modifications to Magento core functionality and additions over several files.

But before doing this, Magento developer must think twice. The main reason is impossibility to choose only the files which should be modified. We need to make changes in the whole Magento core. And the risk of breaking Magento and losing functionality is very high.

Another risky moment is Magento version upgrade. The modified core files can be just the files where the upgrade is done. And then there are two possible variants of a Magento site behavior:

– error notification. And this is even a preferable alternative because it gives a chance to solve the issue;

– unusual and incorrect site functioning.

So after every change in Magento core we have to check all the overrides and to compare previous core and new files to keep the integrity of the site.

We see that Magento core overriding is quite dangerous so we can recommend it only in case of temporary changes while development. In any other situation it is better to develop a Magento extension to add features without tampering Magento core.