Jump to content

Add a new hook to category.tpl without editing ?


evolution.x

Recommended Posts

Hi,

 

Is it possible to add a new custom hook to an existing TPL file in a theme?

 

I am trying to add a newly created hook call to category.tpl without actually editing the TPL.

 

I have created a module which creates the new hook and now need the module to put the hook in to category.tpl ??

 

Is there any override i can do to the TPL or a dynamic load?

 

Any help on this would be great.

 

Link to comment
Share on other sites

it is necessary to modify the .tpl file to run hook there. there is no other way to achieve what you want.

especially because merchants can use different themes, so what then? if the code is totally different than default one?

it's necessary to edit it menually.

Link to comment
Share on other sites

Thanks for your input vekia, I am trying to create a breadcrumb module with BO configuration, this would need to add it's own hook in to all the relevant TPL files which currently display the breadcrumb by an include.

{include file="$tpl_dir./breadcrumb.tpl"}

As far as i know every prestashop theme calls the breadcrumb by the include above, is there any way i could use jquery or similar to swap / replace this breadcrumb include to my hook?

 

Replace:

{include file="$tpl_dir./breadcrumb.tpl"}

With:

{$MY_CUSTOM_HOOK}
Link to comment
Share on other sites

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