Jump to content

How to override prestashop listing controllers in a custom module?

Recommended Posts

Hi community members.

I was trying to override a listing controller from this path `controllers/front/listing/CategoryController.php`.

As you all know you just need to copy and paste this file with the relative path into your custom module like this `modules/mymodule/override/controllers/front/listing/CategoryController.php` and then do the override based on your needs.

After all you just need to install the module in a prestashop instance or reset it if you have installed this before. That is what I went through. But it did not work for me. Actually nothing new appears in `override/controllers/front`.

I checked that in a fresh install of prestashop there is no `listing` folder within this path `override/controllers/front`.

I searched for this and found this answer by @hexadog which says you have to create `listing` folder in `override/controllers/front` and then install or reset your module. And it works for me. Thanks @hexadog

Edited by stifler97
Solved (see edit history)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More