Jump to content

Cleanest way to "disable" a front controller in a theme


Recommended Posts

Hello,

 

I'm developing a custom theme for my shop with prestashop 1.7.2.

 

If I want to fully disable a page in the front office, how should I proceed ?

 

For example, if i want to disable the "my-account" page, I could just delete the "controllers/front/MyAccountController.php" file and be done with it but it isn't right as it will disable the page for every theme...

 

Is it possible to override the MyAccountController.php with an empty file in the theme for example ? Or is there a cleaner way to do that ?

 

Thanks !

Link to comment
Share on other sites

I think it shoud be possible with a custom module without override.

With a module or with override it is possible to get current theme and disable MyAccount page on demand.

 

Is it still possible to override a controller in a theme ?

 

Edit: I tried to override the controller by creating a <theme>/override/controllers/front/MyAccountController.php file and deleting the cache but it doesn't work...

Edited by tiledcode (see edit history)
Link to comment
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...