• Closed by: Fred
  • Closed on: 22.06.20, 00:03
  • Reason: No answer from a customer
  • Comment: Glad to help!

Ticket #17815 - Product page hooks

Hi,

Is there a list of product page hooks and positions?

Thanks,
Rado

Comments

Fred 11 May 2020, 19:20

we don’t have such description, but right now we are working on theme documentation and can add that

Radoslav Polasek 12 May 2020, 06:26

Yes, that would really help.
Right now I need to hook a block in the specific position on a product page. See attached. Is there a hook I can use?

Thanks,
Rado

Attachments:

block.jpg (184.5 KiB)
Radoslav Polasek 15 May 2020, 23:14

Thanks. I tried and it did not work so I contacted an author of the module I mentioned. This is what they suggest:

“Based on your previous capture I think you are referring to the hook “displayMoreButtons” right? So, if you use this name as custom hook this should works, but what’s the problem? some hooks doesn’t include the additional parameter to IDENTIFY the id_product, so, it’s highly probable that this custom hook that your template already includes doesn’t have this parameter and that’s the reason why it does NOT work, so you should follow the steps I described before using a different custom hook name.”

Please check the previous attached image…

In the hook selection select “Custom hook…” You will need insert a name to that custom hook, eg: myCustomHook
You will see the final code in RED, eg: {hook h=’myCustomHook’ product=$product}
Save
Copy this custom code “{hook h=’myCustomHook’ product=$product}” and paste it in the product tpl of your theme

Do you use the same format like the one they mention?
{hook h=’myCustomHook’ product=$product}

Attachments:

hooks.jpg (72.3 KiB)
Fred 16 May 2020, 10:25

ok, just add that hook to any place you want in the template

{hook h='myCustomHook' product=$product}
Radoslav Polasek 18 May 2020, 17:40

OK, thanks.
What is the name of the template file?

Fred 18 May 2020, 18:59

If you need product page - /themes/alysum/templates/catalog/product.tpl

Radoslav Polasek 19 May 2020, 12:58

Did so and unfortunately the content is not shown. The only position where it works and the block is diplayed in something they call displayProductPriceBlock, See attached.

Attachments:

displayProductPriceBlock.jpg (109.9 KiB)
Fred 19 May 2020, 13:11

I suppose you have to register that module in your hook

Radoslav Polasek 20 May 2020, 12:15

Hi,

for your information, this is a reply from a Product Extra Content module developer:

After a very very long time checking your shop theme I was able to activate the displayReassurance hook on the product page. The theme has some serious compatibility issues with Prestashop standards, so I must modify our module to be able to show the content on that hook. Please, backup the current module files and always use this version.

Let me know if you want me to send them any response.

Thanks,
Rado

Fred 20 May 2020, 12:27

Maybe he will give us more details about “incompatibility” and we make it compatible with that module?

Radoslav Polasek 20 May 2020, 18:22

I will ask them.

Radoslav Polasek 20 May 2020, 21:27

FYI, a reply:

Is not our job to check the theme issues. Anyway, for example:
Some native hooks are not present in theme at all.
Recent hooks calls set complete product object (or array) as param, not only product ID.

There are a few changes in module we made. For future updates we can indicate which they are to set it again. Anyway, there is no new version of module planned to release soon.

Fred 21 May 2020, 11:33

I didn’t ask them to validate the theme, but if they write you that “The theme has some serious compatibility issues” I suppose they know what they talking about. But they seems don’t know.

Radoslav Polasek 23 May 2020, 15:43

They mainly mentioned the following issues:
- Some native hooks are not present in theme at all.
- Recent hooks calls set complete product object (or array) as param, not only product ID.

Thanks,
Rado

Fred 24 May 2020, 12:08

Sorry, but that sounds strange.
I’m as a module developer exactly knows what hooks are necessary. Why can’t he give you exact information?