Add a custom tab to woocommerce single product page

Add this below code to your functions.php file. Then chnage the line that shows

echo '

Here\'s your new product tab.

';


You can create a meta field for single product and echo that field here.

echo '

Your Meta box output code here

';





add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
function woo_new_product_tab( $tabs ) {

// Adds the new tab

$tabs['test_tab'] = array(
'title' => __( 'New Product Tab', 'woocommerce' ),
'priority' => 50,
'callback' => 'woo_new_product_tab_content'
);

return $tabs;

}
function woo_new_product_tab_content() {

// The new tab content

echo '

New Product Tab

';

echo '

Here\'s your new product tab.

';


}




#Use the following snippet to change the tab order

add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {

$tabs['reviews']['priority'] = 5; // Reviews first
$tabs['description']['priority'] = 10; // Description second
$tabs['additional_information']['priority'] = 15; // Additional information third

return $tabs;
}