How can I add an extra WooCommerce hook

You can create a hook by calling do_action, then referring to the hook in your functions.php with add_action.

For example, in the theme, where you want the action to occur:

do_action('woocommerce_before_single_product_intro');

Then in functions.php

add_action('woocommerce_before_single_product_intro','your_function',[...]);

For the sake of maintainability, I’d choose a naming convention that doesn’t confuse your hooks with WooCommerce’s.

Leave a Comment