Sébastien SSH Posted December 7, 2021 Share Posted December 7, 2021 Hello I would like to use this new hook called in the twig file : \src\PrestaShopBundle\Resources\views\Admin\Sell\Order\Order\preview.html.twig By this line : {{ renderhook('displayOrderPreview', {'order_id': orderId}) }} I have created a module and this position is new. I would love to use this hook but how can I do it ? I have tried several things but in vain. For exemple in my install function I have added $this->registerHook('displayOrderPreview') And I have created a function just to return a word like this : public function hookOrderPreview($params) { return 'My module is here'; } It doesn't work for me. I think I have to use another way but which one ? 😕 Thank you so much for your help. 🙂 Link to comment Share on other sites More sharing options...
Sébastien SSH Posted December 23, 2021 Author Share Posted December 23, 2021 Up please ! 😅 Link to comment Share on other sites More sharing options...
endriu107 Posted December 23, 2021 Share Posted December 23, 2021 Your method is not connected to hook because it name is different. In twig file is called hook displayOrderPreview in your module you have hookOrderPreview($params) but it should be hookDisplayOrderPreview($params), also in install function you should register this hook. After change you need to reinstal your module. Link to comment Share on other sites More sharing options...
Sébastien SSH Posted December 23, 2021 Author Share Posted December 23, 2021 Ok thank you I will test it then, if it's just a wording problem it's great !! Thank you again I will tell you if it works... the next year lol Best regards. Link to comment Share on other sites More sharing options...
Sébastien SSH Posted January 3, 2022 Author Share Posted January 3, 2022 Thank you, I have tested and it works... I have renamed and it's OK. My fault ! Thank you again and happy new year @endriu107 !! Link to comment Share on other sites More sharing options...
endriu107 Posted January 3, 2022 Share Posted January 3, 2022 I'm Happy to help you Cheers 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