Noel asked this 1 year ago

Add global text in woocommerce product template

I want to add a global text that shows up on all products (not edit the product and add manually), is there a way without altering product template?

guruprakash 1 year ago

If you want it exactly after short description this is better:

function myglobal_short_descr($sdescription)
   $text="Global Text Goes Here";
   return $sdescription.$text;
mohlal 1 year ago

Add this to functions.php of your theme

add_action( 'woocommerce_before_single_product', 'add_text_after_excerpt_single_product', 25 );
function add_text_after_excerpt_single_product()
{    global $product;   
 // Output your custom text    
  echo 'Global Text Goes Here';