Skip to main content

Prestashop Override Module Class [updated] «iOS»

class BlockUserInfoOverride extends BlockUserInfo public function hookDisplayNav($params) // Your custom logic here return parent::hookDisplayNav($params); Use code with caution. Copied to clipboard

<?php /** * Note: Do not declare the namespace here. * The class name must match the original class name. */ class ps_example extends ps_example_parent

Inside that folder, create a file named after the original module’s main class, but with override in the name? – the file must be named exactly like the original class, but placed in override.

// Your custom code here $result = parent::hookDisplayHeader($params);

public function install()

Only one module can override a specific class method at a time. If a second module attempts to override the same class, PrestaShop will throw an error or ignore the second override.