Hello Friends,
The below code will help you to Customize a product tab in woo commerce using 'woocommerce_product_tabs' action hook, first you have to replace the description tab with a custom function.
<?php
add_filter( 'woocommerce_product_tabs', 'woo_findnerd_custom_description_tab', 8 );
function woo_findnerd_custom_description_tab( $destabs ) {
$destabs['description']['callback'] = 'woo_findnerd_custom_description_tab_content'; // description callback with custom function
return $destabs;
}
function woo_findnerd_custom_description_tab_content() {
echo '<h1>TYPE YOUR TITLE Here</h1>'; //
echo '<p>TYPE YOUR DESCRIPTION HERE </p>'; //
}
?>
In above code we are replacing default product description with our custom description.
Here woocommerce_product_tabs is an action hook function of woocommerce which holds product tab of woocommerce.
And woo_findnerd_custom_description_tab is a user defined function that you can change it according to your wish.
0 Comment(s)