Home / Admin / Product tabs
Duplicate Snippet

Embed Snippet on Your Site

Product tabs

ADDS A TAB IN PRODUCT PAGES

Carla Mawyin
<10
Code Preview
php
<?php
/**
 * 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['test_tab'] = array(
		'title' 	=> __( 'Shipping Info', 'woocommerce' ),
		'priority' 	=> 50,
		'callback' 	=> 'woo_new_product_tab_content'
	);
	return $tabs;
}
function woo_new_product_tab_content() {
	// The new tab content
	echo '<h2>Shipping Info</h2>';
	echo '<p>We offer both delivery and pickup options. <br>Once you checkout, you can choose which method you would prefer, your preferred date and for pickup, you can choose your time. <br> Click on the FAQ link below to get more information on shipping information, picking up options and ordering instructions</a></p>';
	echo '<p><a href="https://carlacookiebox.com/faq/" target="_blank" rel="noopener">FAQ</a></p>';
	
}

Comments

Add a Comment