The WooCommerce product tabs are pretty powerful once you understand the hooks and actions. See Modifying or Removing Product Tabs in Woocommerce.
That post discusses how to modify or hide product tabs in WooCommerce. This post describes how you can conditionally show them. For example, only show a tab if isn’t empty.

Here we are adding an Ingredients tab. Ingredients are stored in Post Meta as ingredients.

So initially, we return that custom post meta, if it exists, we can create a product tab.

add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
function woo_new_product_tab( $tabs ) {
global $post, $product;
$ingredients = get_post_meta($post->ID, 'ingredients', TRUE);
// Adds the new tab
if (!empty($ingredients)) {
$tabs['test_tab'] = array(
'title' => __( 'Ingredients', 'woocommerce' ),
'priority' => 50,
'callback' => 'woo_new_product_tab_content'
}return $tabs;
function woo_new_product_tab_content() {
global $post, $product;
$ingredients = get_post_meta($post->ID, 'ingredients', TRUE);