0
votes

I have a smartblog module in Prestashop 1.6 and I need to override /modules/smartblog/controllers/admin/AdminBlogPostController.php controller. How can I do it?

I've updated the file, added needed code and updated the name:

class AdminBlogPostControllerOverride extends AdminBlogPostController

I tried these ways but they didn't work for me:

  1. I put the file into /override/modules/smartblog/controllers/admin/AdminBlogPostController.php
  2. I put the file into /override/controllers/AdminBlogPostController.php
  3. I put the file into /modules/smartblog/override/controllers/admin/AdminBlogPostController.php

But nothing changed. Can anyone help me to find a mistake in my code?

Thanks in advance.

2
What exactly you'd like to do? There are number of "action" Hooks which are very helpful when it comes to overriding BO - Krystian Podemski

2 Answers

0
votes

As I know, you can't override module controllers by default in the Prestashop (1.6).

What you can do:

  1. This module is not a core module, so you can edit it directly
  2. Follow this tutorial : override module controller in PS 1.6 and then you can do it
  3. Generate new module with custom AdminController and in the header or dispatcher hooks (in your module), you can redirect the page to your custom page
0
votes

Just put this file into:

/modules/smartblog/controllers/admin/AdminBlogPostControllerverride.php

and then create a new tab from Administrator -> Menues.