prestashop overriding system works like many others by using the file naming scheme. So basically, I'll create a class in /overrides/classes with the same class and file name of another in /classes, just to simplify. Well, I've got to override this (with latest prestashop versions a module can be overridden, with previous we couldn't):
include_once(dirname(__FILE__).'/MailAlert.php');
class MailAlerts extends Module{
[....]
}
I can override it with this:
class MailAlertsOverride extends MailAlerts{
[....]
}
Well, it works, the file and the class get recognized, but I've got problems with the originally included MailAlert class. I cannot reinclude it, but if I don't include it, the module will ask for it.
I'd prefer not to modify the parent class. Is there a way to solve this problem?
Ok, I was wrong: the code above just works :)
For those who didn't know (it's a relatively new prestashop feature), you can override a module in
/override/modules/[modulename]/[modulename.php]And using the special class naming you can read above:
modulenameOverride extends modulename