user2393886
user2393886

Reputation: 872

Overriding in module not working in prestashop

I am new to prestashop and developing a module to change behaviour of checkout process. As i am new, i am first overriding IndexController.php file in my module directory to just test the overriding mechanism in prestashop. The directory structure, i have followed, to override controller file as:

modules/my_modules/override/controllers/front/IndexController.php  

Below is the code of above file:

class IndexController extends IndexControllerCore{

  public function __construct() {
    parent::__construct();
    d('You are overriding index file');
  }    
}

In above code, i have just created an construct and print a test string with die. But nothing is happening on the home page on front end. I have also tried with override another controller file, but i have got same result.

I have searched many things on google, but nothing got. Please anyone tell me, what i am doing wrong in this? if the logic is correct, then why overriding is not working here?

Waiting for solution.

Upvotes: 1

Views: 1957

Answers (1)

Florian Lemaitre
Florian Lemaitre

Reputation: 5748

Like @rsanchez said. You need to reinstall the module everytime you change your module's overrides. Prestashop will not automatically check for new changes or new overrides without it.

Upvotes: 1

Related Questions