Search code examples
overridingprestashopfront-controller

Prestashop 1.5 Override FrontController


I'm trying to create an override for /classes/controller/FrontController.php. For testing purposes, I got the original method written like this:

protected function canonicalRedirection($canonical_url = '')
{
    die('Original method');
    ...

and the testing class /override/classes/controller/FrontController.php is written like this

class FrontController extends FrontControllerCore
{
    protected function canonicalRedirection($canonical_url = '')
    {
        die('Overriden method');
    }

}

But it always outputs Original method

Is there something i'm doing wrong? By the way, this works on different domain, but not on the one I'd like it work, so there is probably even more complicated stuff going on.

Thanks for any kick!


Solution

  • In order to override FrontController you need to add new file in override/classes/FrontController.php