Product description is showing at below the product summary. In this tutorial I am showing how you will display it above the product summary section (see the screenshot)
Here is the steps
You will add all custom PHP codes in your theme’s functions.php file or any other place. It is totally depending on you.
Unset the Description Tab
At first I am removing the product description tab from existing tabs. There have a filter woocommerce_products_tabs. You add or delete any tabs with this file. I wrote following script and deleting the description tab.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
/** * Remove the description tab * * @author Paul * @license GPL 2.0+ */ add_filter( 'woocommerce_product_tabs', 'paul_unset_woocommerce_default_product_tabs'); function paul_unset_woocommerce_default_product_tabs( $tabs = array() ) { if ( ! is_array( $tabs ) ) { return; } unset( $tabs['description'] ); return $tabs; } |
Re-positioning the Product Description
Moving the description above the product summary. There have a hook woocommerce_before_single_product_summary which will display the content above the summary on single product details page. I am triggering this hook.
1 |
add_action('woocommerce_before_single_product_summary', 'woocommerce_product_description_tab'); |
woocommerce_product_description_tab() function is already exist in WooCommerce plugin. It is showing the product description.
Leave a Reply