dhod
dhod

Reputation: 451

WooCommerce - Move Product Description out Tabs into Summary

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!

Upvotes: 13

Views: 31521

Answers (2)

dhod
dhod

Reputation: 451

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 );`

Upvotes: 29

i-Create Web
i-Create Web

Reputation: 131

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;

}

Upvotes: 13

Related Questions