Reply 67275 to: How to add tab bars in product page?

Avatar: Eva
Eva Kemp
Support staff
June 1, 2015 at 12:18

Hello @stp33,

If you want to add custom tab to a product you need add this code into functions.php file:

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 '<h2>New Product Tab</h2>';
	echo '<p>Here\'s your new product tab.</p>';
	
}

Tab content is added inside of this code:

echo '<h2>New Product Tab</h2>';
echo '<p>Here\'s your new product tab.</p>';

between <p></p> tags.

If you have questions concerning tabs editing you need contact Woocommerce support team.

Thank you.
Regards,
Eva Kemp.

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.