bkprestashop Posted January 3, 2022 Share Posted January 3, 2022 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 More sharing options...
ps8modules Posted January 3, 2022 Share Posted January 3, 2022 (edited) /modules/<my_module_name>/override/modules/<other_module_name>/controllers/admin/AdminSellerProductDetailController.php Edited January 3, 2022 by 4you.software (see edit history) Link to comment Share on other sites More sharing options...
bkprestashop Posted January 3, 2022 Author Share Posted January 3, 2022 hi @4you.software, Thanks for your reply, but this doesnt work for me 28 minutes ago, 4you.software said: /modules/<my_module_name>/override/module/<other_module_name>/controllers/admin/AdminSellerProductDetailController.php Link to comment Share on other sites More sharing options...
ps8modules Posted January 3, 2022 Share Posted January 3, 2022 https://devdocs.prestashop.com/1.7/modules/concepts/overrides/#override-module-frontadmin-controllers-classes-by-extending-them Link to comment Share on other sites More sharing options...
bkprestashop Posted January 3, 2022 Author Share Posted January 3, 2022 (edited) 7 minutes ago, 4you.software said: https://devdocs.prestashop.com/1.7/modules/concepts/overrides/#override-module-frontadmin-controllers-classes-by-extending-them @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 January 3, 2022 by bkprestashop (see edit history) Link to comment Share on other sites More sharing options...
ps8modules Posted January 3, 2022 Share Posted January 3, 2022 class AdminBlockListingControllerOverride extends AdminBlockListingController Link to comment Share on other sites More sharing options...
bkprestashop Posted January 3, 2022 Author Share Posted January 3, 2022 1 minute ago, 4you.software said: class AdminBlockListingControllerOverride extends AdminBlockListingController @4you.software yes, i have also done this, nothing works. Link to comment Share on other sites More sharing options...
ps8modules Posted January 3, 2022 Share Posted January 3, 2022 Check if the file "exists" in ./override/modules/marketplace/controllers/admin/AdminSellerProductDetailController.php Link to comment Share on other sites More sharing options...
bkprestashop Posted January 3, 2022 Author Share Posted January 3, 2022 14 minutes ago, 4you.software said: Check if the file "exists" in ./override/modules/marketplace/controllers/admin/AdminSellerProductDetailController.php @4you.software nope, when i reinstall the module it won't copy to the ./override/modules/... path. Even if i clear the cache. Link to comment Share on other sites More sharing options...
ps8modules Posted January 3, 2022 Share Posted January 3, 2022 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? Link to comment Share on other sites More sharing options...
bkprestashop Posted January 4, 2022 Author Share Posted January 4, 2022 @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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now