lunchtime-Prediction Posted October 20, 2023 Share Posted October 20, 2023 Hi, I want to execute my code when exporting the template, I found the action<AdminControllerClassName><Action>Before hook on the list So I'm trying to add the actionThemesExportBefore hook - but it doesn't help, does anyone have an idea how to do it? Any suggestion are most welcome. Thank You Link to comment Share on other sites More sharing options...
ps8modules.com Posted October 22, 2023 Share Posted October 22, 2023 Hi. No such controller exists and such a hook cannot be used. You can add your code via override to ./src/PrestaShopBundle/Controller/Admin/Improve/Design/ThemeController.php => exportAction() 1 Link to comment Share on other sites More sharing options...
Zohaib-fk Posted October 22, 2023 Share Posted October 22, 2023 Hi, I think a custom hook in PS will help. Below are 2 documentation links for your reference. https://belvg.com/blog/creating-custom-hooks-in-prestashop-1-7.html https://devdocs.prestashop-project.org/8/modules/concepts/hooks/ 1 Link to comment Share on other sites More sharing options...
ps8modules.com Posted October 22, 2023 Share Posted October 22, 2023 (edited) @Zohaib-fk so can you give the exact procedure of the hook for this case? I know, I'll answer straight away that you can't use any hook, but only create an override for ThemeController.php in the module 😉 Many beginner programmers need your help. Sharing links is not enough. Every one of them has already visited the Prestashop documentation and believe me, no one understands it. I have been programming for Prestashop for more than 10 years and the documentation has never helped me. If you do, we'd love your code samples. That's the purpose of fàa, to help, not to copy links. Edited October 22, 2023 by ps8moduly.cz (see edit history) 1 Link to comment Share on other sites More sharing options...
JBW Posted October 22, 2023 Share Posted October 22, 2023 As @ps8moduly.cz said there is no hook. But AFAIK there is the option to use new symfony controller override/decoration procedure:https://devdocs.prestashop-project.org/1.7/modules/concepts/controllers/admin-controllers/override-decorate-controller/ 1 Link to comment Share on other sites More sharing options...
ps8modules.com Posted October 22, 2023 Share Posted October 22, 2023 (edited) @JBW yes, that's true, but for the less experienced, it's a daunting task. Many beginner programmers need your help. Sharing links is not enough. Every one of them has already visited the Prestashop documentation and believe me, no one understands it. I have been programming for Prestashop for more than 10 years and the documentation has never helped me. If you do, we'd love your code samples. That's the purpose of fàa, to help, not to copy links. Edited October 22, 2023 by ps8moduly.cz (see edit history) Link to comment Share on other sites More sharing options...
JBW Posted October 25, 2023 Share Posted October 25, 2023 I think the documentation has imroved a lot recently and indeed I was able to decorate controllers with this knowledge. If you need code I recommend the example modules: https://github.com/PrestaShop/example-modules 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