Override folder functionality and conflicts?
I have a class file called group.php
in the prestashop base code.
I want to add a new field and make some functional changes to that group.php
file.
I have created a custom module and did those changes there. When i install that module, my inherited group.php
file is sent to the Base Override folder and stays there.
Now my question is,
How that override functionality is working?
How the conflicts are managed by prestashop?
For eg: I have 2 modules which are seperately overriding the same file group.php
.
If i install those 2 module simultaneously which group.php
will be there in the base override folder?
When two modules are overriding the same file then PrestaShop adds a comment at the top of overridden function(s) to identify which function in overridden by which module.
Example of that comment is:
You can check this in the overridden file on your end (/override/classes/group.php) in your case.
The overridden code is then remove using these comments only when any module is uninstalled and if only a single module is overriding the module then the file gets deleted.