Prestashop Override Module Class Work Jun 2026
: You must extend the original module class and append Override to your new class name. For example, to override the BlockUserInfo module, your class should be named BlockUserInfoOverride .
If your override isn’t working:
To override a module's main class, you must create a new PHP file that extends the original class. Unlike core class overrides, module overrides use a specific naming convention: appending the suffix to the class name. prestashop override module class
| Method | Safe for Updates | Complexity | Use Case | |--------|----------------|------------|-----------| | | ✅ Yes | Medium | Changing module method logic | | Direct Edit | ❌ No | Low | Quick prototyping (never production) | | Hook | ✅ Yes | Low | Adding new behavior without changing existing methods |
Only use overrides when the module doesn’t dispatch necessary hooks. : You must extend the original module class
<?php // override/modules/mybankpayment/MyBankPayment.php
: Experts from Knowband and the official documentation suggest using hooks instead of overrides whenever possible, as they are less likely to cause conflicts during updates. Unlike core class overrides, module overrides use a
: This is the most common pitfall. After adding your file, you must delete /cache/class_index.php or clear the cache via the PrestaShop back office (Advanced Parameters > Performance) to trigger the new logic. Best Practices & Pitfalls
// Add custom logic BEFORE parent execution PrestaShopLogger::addLog("Custom: Validating order for cart #$id_cart", 1, null, 'Cart', $id_cart);
/override/modules/[module_name]/controllers/[front or admin]/[ControllerName].php
Every override is technical debt. Document it, test it, and remove it if the module author later adds native support for your customization.


















