WP-Hook: Override template

You can use a hook to override the templates. Thus, e.g. the previous standard template on a separate template.

Affiliate Toolkit provides several hooks for modifying the template, so you can use e.g. also print another template if no price should be available.

General function

This function is used with lists and products, so you can redirect the template in general.

Parameter Description
template Template-ID or Template-Name (if from the file system).
Rückgabewert The overridden template.

Function for the list

This function is called only for a list. For example, due to conditions.

Parameter Description
template Vorlagen-ID oder Vorlagen-Name (wenn aus dem Dateisystem).
id The list-ID or the list-Name (depending on useage in Shortcode).
content The field “content” which is added to the shortcode.
Return value The overridden template.

Function for the product

This function is only available for one product. With this, you can for example override the template due to conditions.

Parameter Description
template Vorlagen-ID oder Vorlagen-Name (wenn aus dem Dateisystem).
id The product-ID or the product-Name (depending on useage in Shortcode).
content The field “content” which is added to the shortcode.
Return value The overridden template.

 

Tip: Use a plugin like My Custom Functions or a child theme to build your hooks!

Do you still have questions? No problem :-)
We are happy to answer your questions in our forum.