Adding a new Tab on Product detail page in woo commerce

Adding a new Tab on Product detail page in woo commerce
/**
 * Add a custom product data tab
 */
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
function woo_new_product_tab( $tabs ) {
	
	/**
 	* Adds the new tab
 	*/

	$tabs['health'] = array(
		'title' 	=> __( 'Health', 'woocommerce' ),
		'priority' 	=> 10,
		'callback' 	=> 'woo_new_product_tab_content'
	);

	return $tabs;

}
function woo_new_product_tab_content() {
	global $product;
	$product_id = $product->get_ID();
    //$link = get_field('links_to_resources_to_support_health_benefits');
    $link2 = get_field('commonly_used_for');
    echo 'Related Resource:';
    if( have_rows('new_rept') ):
    while ( have_rows('new_rept') ) : the_row();
        $link = get_sub_field('list_of_links');
        echo '

'.$link.'

'; endwhile; endif; echo '

'.$link2.'

'; }

screen65

screen66

Leave a Reply

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