Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WooCommerce - Move Product Description out Tabs into Summary

Tags:

woocommerce

I've hunted high and low how to move the Product Description on a Single Product page of Woocommerce out of the tabs and in to the main section. I just can't find it anywhere!

If anybody can help me out it would be massively appreciated as i'm losing my mind a bit!

Thanks Dan

Edit:

Just after submitting this I had an idea, all of the hooks are just functions so I created a new function and included the product description code:

function woocommerce_template_product_description() {
   woocommerce_get_template( 'single-product/tabs/description.php' );
 }

add_action( 'woocommerce_single_product_summary', 'woocommerce_template_product_description', 20 );

I'm not sure how perfect a method that is but it does the job I need it to do!

like image 707
dhod Avatar asked Oct 27 '13 17:10

dhod


People also ask

How do I move the Additional Information tab in WooCommerce?

All you need to do is install a plugin like YITH WooCommerce Tab Manager and activate it. Once active, use the plugin options to remove, change or delete the WooCommerce tabs. You can even create your custom tab. The benefit of using this method is that is the most simple and the most beginner-friendly.

How do I move a short description in WooCommerce?

Please go to Appearance > Customize > WooCommerce > Single Product, and move the Excerpt element where you want it to be displayed (just click and drag).


2 Answers

Just after submitting this I had an idea, all of the hooks are just functions so I created a new function and included the product description code:

function woocommerce_template_product_description() {
woocommerce_get_template( 'single-product/tabs/description.php' );
}
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_product_description', 20 );

Edit: since latest versions of woocommerce this code should still work like so

function woocommerce_template_product_description() {
wc_get_template( 'single-product/tabs/description.php' );
}
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_product_description', 20 );`
like image 153
dhod Avatar answered Sep 27 '22 20:09

dhod


This worked great, thanks for the solution to my problem!

To get rid of the tabs, use this code -

add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );

function woo_remove_product_tabs( $tabs ) {

  unset( $tabs['description'] );        // Remove the description tab
  unset( $tabs['reviews'] );            // Remove the reviews tab
  // unset( $tabs['additional_information'] );      // Remove the additional information tab

  return $tabs;

}
like image 34
i-Create Web Avatar answered Sep 27 '22 21:09

i-Create Web