Let's say there is a module with version 0.1.
This module already have overrides applied for example to classes/Cart.php.
New requirement comes in and we make a change to an already overridden classes/Cart.php.
To apply new change we update module version to 0.2, but after update Prestashop doesn't reapply new overrides. I also tried placing upgrade script in upgrade folder which I confirmed was executing but old override is still there.
How do you apply new overrides without reinstalling the module?
In the upgrade method you could run in sequence uninstallOverrides and installOverrides, it would result in installing the state of your overrides at your current version.
File upgrade/upgrade-1.1.0.php:
function upgrade_module_1_1_0($module)
{
$module->uninstallOverrides();
$module->installOverrides();
return true;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With