TPL or template hooks are parts of a template enclosed in the tags:
{hook name="section:hook_name"} ... {/hook}
that can be supplemented or completely redefined by any add-on.
This is an example of a template hook from the file skins/basic/admin/views/order_management/totals.tpl:
{hook name="order_management:product_info"} {if $cp.product_code} <p>{$lang.sku}: {$cp.product_code}</p> {/if} {/hook}
TPL hooks are used to show additional data in an existing template. For example, if an add-on collects some data that should be shown in the store administration panel in a separate block, this block can be added using a TPL hook.
Unlike PHP hooks, template hooks should not be declared explicitly. A proper file naming and placing will do the trick.
The naming algorithm is as follows:
skins/[skin name]/[admin|customer]/addons/[addon id]/hooks/[template name]/[hook name].[pre|post].tpl
Questions & Feedback
Have any questions that weren't answered here? Need help with solving a problem in your online store? Want to report a bug in our software? Find out how to contact us.