Add a third description on the Single Product Page

There are times when the “long description” and the “short description” are not enough on the WooCommerce Single Product page. What if you need to add another HTML content section – say – at the very bottom of the page?

In this simple snippet, we will add another “WYSIWYG” text editor in the Edit Product page, and display the output at the bottom of the single product page. Enjoy!

Here’s an additional piece of content I was able to add to the bottom of the single product page thanks to the snippet below.
And this is the backend – a new meta box on the Edit Product page where you can enter HTML content
add_action( 'add_meta_boxes', 'bbloomer_new_meta_box_single_prod' );
 
function bbloomer_new_meta_box_single_prod() {
   add_meta_box(
      'custom_product_meta_box',
      'Product third description',
      'bbloomer_add_custom_content_meta_box',
      'product',
      'normal',
      'default'
   );
}
 
function bbloomer_add_custom_content_meta_box( $post ){
   $third_desc = get_post_meta( $post->ID, '_third_desc', true ) ? get_post_meta( $post->ID, '_third_desc', true ) : '';   
   wp_editor( $third_desc, '_third_desc' );
}
 
add_action( 'save_post_product', 'bbloomer_save_custom_content_meta_box', 10, 1 );
 
function bbloomer_save_custom_content_meta_box( $post_id ) {
   if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
   if ( ! isset( $_POST['_third_desc'] ) ) return;
   update_post_meta( $post_id, '_third_desc', $_POST['_third_desc'] );
}
 
add_action( 'woocommerce_after_single_product_summary' , 'bbloomer_third_desc_bottom_single_product', 99 );
   
function bbloomer_third_desc_bottom_single_product() {
   global $product;
   $third_desc = get_post_meta( $product->get_id(), '_third_desc', true ) ? get_post_meta( $product->get_id(), '_third_desc', true ) : '';
   if ( ! $third_desc ) return;
   echo '<div>';
   echo $third_desc;
   echo '</div>';
}

Comments

12 responses to “Add a third description on the Single Product Page”

  1. PHL63? Yeah, played there a bit. Decent enough. I’ve been better but I’ve seen worse. If you want the details of phl63 there is the link!

  2. Alright, looking into segurober. Hoping for some smooth sailing and maybe a big win. Let’s see what this place has to offer! Explore more at segurober

  3. Downloading u7777gameapk. Feels like a good find. Hoping it’s as good as they say. Check it out here u7777gameapk

  4. RP8888xyz… bit of a weird name, but the site’s legit. Easy to navigate and had some interesting stuff. Check it out, you might find something you like. Right here rp8888xyz

  5. Zeetben, never heard of it before, but I gave it a try. Pretty straightforward website, nothing too flashy. A decent option if you’re looking for something new. Take a peek at zeetben

  6. CN777slot! Love a good slot game. This site had a lot of them, and I actually won a little something. Definitely worth spinning for. All the slots at cn777slot

  7. Necesito un buen 1winpromocode para sacarle el jugo a mi depósito. ¡Espero que este sitio tenga lo que busco! Ya quiero empezar a ganar con 1winpromocode

  8. Been playing on 56dbetcom for a while now and gotta say, it’s pretty solid. The games are fun and I haven’t had any major issues. Worth checking out, for sure! Click here: 56dbetcom

  9. I’ve heard some buzz about fc188. Seems like a decent option if you’re looking for some online entertainment. Do your research, but it might be worth a peek. Check them out through this link: fc188

  10. Just tried out Mexganacasino and gotta say, it’s pretty slick! Easy to navigate and had some fun playing. Worth checking out if you’re looking for a new spot to chill and play. Check them out here: mexganacasino

  11. Downloaded the wjslot app, and it’s not bad at all. Runs smoothly on my phone, and the games are pretty entertaining. Perfect for killing time on my commute! Check the app out: wjslot app

  12. Had a little trouble finding the right login page for p828login, but once I got in, it was smooth sailing. Make sure you bookmark it! Access easily here: p828login

Leave a Reply to zeetben Cancel reply

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