Function for adding a shortcode to product template not working

So I need to add a shortcode [stag_sidebar id='product'] to each single product page in Woocommerce. Specifically in short description. Here’s what I tried but this isn’t working:

add_filter( 'woocommerce_short_description', 'custom_woocommerce_short_description' );

function custom_woocommerce_short_description( $description ) {
global $post;

$description = $description . do_shortcode('[stag_sidebar id='product']') ;

return $description;
}

Read more here: Function for adding a shortcode to product template not working

Leave a Reply

Your email address will not be published. Required fields are marked *