Jump to content

Unable to override a custom module's admin controller


Recommended Posts

Hi,

I created a module and I want to override an admin controller from an existing module. I created the override folder using the path modules/mymodule/override/modules/marketplace/controllers/admin/AdminSellerProductDetailController.php following https://devdocs.prestashop.com/1.7/modules/concepts/overrides/ but it does not seem to copy into the /override/ folder. I've reinstalled the module, deleted the cache, but nothing seems to work.

Couldn't find any solutions on the forum or anywhere else online, so your help is very much appreciated.

I am using Prestashop 1.7.7.2.

 

Link to comment
Share on other sites

7 minutes ago, 4you.software said:

@4you.software

yes, i've followed the documentation exactly, as i've explained in the post. Nothing is working even if i follow the dev docs.

Edited by bkprestashop (see edit history)
Link to comment
Share on other sites

@4you.software

Essentially, this is what I did. I have a module called 'mymodule' and I want to use this module to override an admin controller from another module called 'marketplace', and my path for the override is modules/mymodule/override/modules/marketplace/controllers/admin/AdminSellerProductDetailController.php

Inside the file, I did something like this 

<?php

class AdminSellerProductDetailControllerOverride extends AdminSellerProductDetailController {
	public function __construct()
	{
		PrestaShopLogger::addLog('test', 1);
	}
}

As far as I know, I've exactly followed what the Prestashop documentation said to do, but without much success.

 

14 hours ago, 4you.software said:

It is difficult to advise if one does not see what it looks like for you, whether the code for override is correct, etc.
When you turn on debug mode and profiling, isn't there a mistake?

There's no mistake when debug mode is turned on.

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...