13

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!

dhod
  • 461
  • 1
  • 5
  • 11
  • 1
    Hi, could you please, instead of editing the answer into your question, add an own answer, which you might accept. – bummi Dec 09 '13 at 15:58

2 Answers2

30

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 );`
dhod
  • 461
  • 1
  • 5
  • 11
  • 6
    For anyone looking at this answer it's still valid and works great.However, the woocommerce_get_template function is being deprecated and replaced by wc_get_template so I'd suggest you use that. – user319940 May 23 '14 at 15:33
  • It's possible to do this to additional information tab? – codajoao Jun 20 '15 at 04:55
  • Not working anymore. Does anyone knows how to make this work with WordPress 4.2+ and WooCommerce 2.5.5+? – Jonathan Soifer Apr 07 '16 at 18:40
  • @JonathanSoifer replace `woocommerce_get_template` with `wc_get_template` in the answer's code. – Steve May 04 '16 at 12:20
  • since the description field is equal to the content field in Wordpress you can get the output by simple. echo the_content(); instead of loading the wc_get_template – nh-labs Nov 16 '21 at 11:02
  • This doesn't work as intended. I just tested it and it shows description on two places. I adds one more description into summary. Why is this accepted as answer? – Raymond Feb 08 '23 at 19:08
12

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;

}
bardzusny
  • 3,788
  • 7
  • 30
  • 30
i-Create Web
  • 121
  • 1
  • 4
  • Actually, if you wanna get rid of the tabs completely, merely do `$tabs = []` within that function. No need to target each node individually. It will, of course, disable any tabs added by plugins in the future. – InanisAtheos Feb 06 '20 at 14:59