Override Module: Prestashop
: Use the original class name with an Override suffix.
rm -rf var/cache/prod/class_index.php # or for development rm -rf var/cache/dev/class_index.php
class Ps_ShoppingcartOverride extends Ps_Shoppingcart // Your custom methods here Use code with caution. override module prestashop
Instead of editing the module's files directly—which would erase your changes the moment you update the module—you should use an .
// Add your own code here $this->context->controller->addCSS($this->_path . 'views/css/custom.css'); : Use the original class name with an Override suffix
When PrestaShop loads, it checks for override files. If an override exists, it uses that class instead of the original one. This allows you to:
mkdir -p override/modules/mymodule
It is crucial to distinguish between overriding the Module's own file versus overriding a Core Class that the module uses.
Let's imagine we have a module named customslider and we want to modify its main class. This allows you to: mkdir -p override/modules/mymodule It