Ikoshop Posted December 16, 2024 Share Posted December 16, 2024 (edited) I need to add some buttons to trigger functions from my stock management module (currently in development). I'd like to put them in the backoffice, somewhere like here I think I need a display hook, linked to a function which in turn calls the functions I want to trigger. I also think I need to edit a tpl file in order to display the buttons. Question: Which .tpl file should I be looking at editing for the products list screen in the back office? And, assuming this is the proper procedure, how do I make it so that this .tpl file updates with the new buttons on a Prestashop installation? I'm guessing there's some sort of override run from the module itself but I haven't figured out how that all works. Edited January 2 by Ikoshop solved (see edit history) Link to comment Share on other sites More sharing options...
Nickz Posted December 16, 2024 Share Posted December 16, 2024 Have you read the documentation? https://devdocs.prestashop-project.org/8/modules/sample-modules/order-pages-new-hooks/additional-action-buttons/ Link to comment Share on other sites More sharing options...
Ikoshop Posted December 17, 2024 Author Share Posted December 17, 2024 (edited) I've read everything I could but just can't find anything relating to the product list page in v 1.7 ps_mbo.php seems to have some of the content of that zone but I'm stuck on how to edit it Edited December 17, 2024 by Ikoshop (see edit history) Link to comment Share on other sites More sharing options...
ST-THEMES Posted December 24, 2024 Share Posted December 24, 2024 Hi, Did you try the displayDashboardTop? Best regards. Link to comment Share on other sites More sharing options...
Ikoshop Posted January 2 Author Share Posted January 2 Hi, I've tried both the displayDashboardToolbarTopMenu and displayDashboardToolbarIcons as per the guide here: https://devdocs.prestashop-project.org/8/modules/concepts/hooks/use-hooks-on-modern-pages/#first-step-select-the-right-hook But nothing works as described. In debug mode, the hook displayDashboardToolbarIcons is not listed as available at all, the hook displayDashboardToolbarTopMenu is listed as available but when registering it in a module and attaching a function, the function is not called and the hook is listed as not used by a module. I've tried with version 8.2 as the guide is listed under version 8 of Prestashop. Link to comment Share on other sites More sharing options...
Ikoshop Posted January 2 Author Share Posted January 2 I managed to get hookDisplayDashboardToolbarTopMenu working by forcing the hook to attach in the BO and filtering the view on the context->controller->controller_name Link to comment Share on other sites More sharing options...
ST-THEMES Posted January 3 Share Posted January 3 Hi, Yes, that is the trick. Best regards. 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