WooCommerce adds additional tabs to the product details page
WooCommerce development allows you to use filter hookswoocommerce_product_tabs
Add additional tabs next to descriptions, comments, and other information on the product page.
Suppose you want 2 additional tabs-titled “Ingredients” and “How To Use”, which can be used like thiswoocommerce_product_tabs
Filter hooks…
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
/**
* Add 2 custom product data tabs
*/
function woo_new_product_tab( $tabs ) {
// Adds the new tab
if(get_field('ska_ingredients')){
$tabs['ingredient_tab'] = array(
'title' => __( 'Ingredients', 'woocommerce' ),
'priority' => 15,
'callback' => 'ska_ingredients_callback'
);
}
if(get_field('ska_works')){
$tabs['work_tab'] = array(
'title' => __( 'How To Use', 'woocommerce' ),
'priority' => 15,
'callback' => 'ska_works_callback'
);
}
return $tabs;
}
There are 3 parameters in the array value:
title
is the title text of the tabpriority
It is the priority. The smaller the number, the higher the display is.callback
The name of the callback function will be output from the contents of this tab.
In our example, we call the value of a field in the callback function (see code below), so we use theif
conditionsif(get_field('ska_works'))
First check whether the field exists. If it does not exist, the tab will not be output.
function ska_ingredients_callback() {
echo the_field('ska_ingredients');
}
function ska_works_callback() {
echo the_field('ska_works');
}
The final effect is roughly as follows:

Content reference from: wpbeaches.com/add-extra-tabs-on-woocommerce-products/