Code Snippet To Remove Additional Information Tab in WooCommerce

In WooCommerce you can see all the information added as attributes in Additional information tab in single product page. But for some reason in one of our recent development process for one of our client, we wanted to remove this tab completely and we came accross the following solution. You just nee to add the following code in your theme’s functions.php file

add_filter( ‘woocommerce_product_tabs’, ‘woo_remove_product_tabs’, 98 );

function woo_remove_product_tabs( $tabs ) {
global $product;

if( $product->has_attributes() || $product->has_dimensions() || $product->has_weight() ) {
unset( $tabs[‘additional_information’] );
}
return $tabs;
}

 

Author: mytutorialguru

Share This Post On

Submit a Comment

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