/override/modules/mymodule/controllers/front/DefaultController.php
/** * Add a completely new method (available to the module) */ public function myCustomMethod() override module prestashop
The class must be named OriginalModuleClassOverride (e.g., MyModuleOverride ) and extend the original class. Step 3: Clear the class index cache rm -rf var/cache/prod/class_index.php # or for development rm -rf var/cache/dev/class_index.php Step 4: Enable the override No further action needed – PrestaShop will automatically load the override class on the next request. 4. Override a Module Controller To override a front controller of module mymodule named DefaultController : override module prestashop