Pratik Bhatt

How to add content below media gallery in woocommerce

One of the ain feature of woocommeerce is the media gallery that is present on the left had side column on the default woocommerce. Now what if we want to add a piece of text below it so we can add content / HTML below it.

In fact, the gallery completely replaces the default content via JQuery, including that particular hook. Adding content is not as easy as it used to be.

Hence , in this blogpost I will be sharing the code snippet that will be used to make this functionality working.

add_action( 'woocommerce_after_single_product_summary' , 'pkbhatt_add_below_prod_gallery', 5 );
  
function pkbhatt_add_below_prod_gallery() {
   echo '<div class="woocommerce-product-gallery" style="background: #fdfd5a; padding: 1em 2em">';
   echo '<span>THIS IS A TEST. YOU CAN ADD TEXT, IMAGES AND ANY HTML</span>';
   echo '</div>';
}

Leave a Reply