Action Hook in a shortcode
-
I’m using the Cart Notices extension and I want to use one of the shortcodes on the product page. Would adding this to the functions.php file work?
add_action(‘woocommerce_before_single_product’, ‘my_function_name’);
function my_function_name() {
echo do_shortcode(‘[woocommerce_cart_notice]’);
}I would like to embed this notice(shortcode) without editing the template file. I know there has to be a simple way to do this.
Thanks
- The topic ‘Action Hook in a shortcode’ is closed to new replies.