Jump to content

[1.7.8] How to use the new hook displayOrderPreview ??


Recommended Posts

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

  • 3 weeks later...

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

  • 2 weeks later...

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