How to add a custom tab for single product tabs in woocommerce wordpress

For add a custom tab in single product page tabs just copy and paste below code into your theme's functions.php file

add_filter( 'woocommerce_product_tabs', 'rj_single_product_additional_tab' );
function rj_single_product_additional_tab( $tabs ) {
$tabs['additional_info'] = array(
'title' => __( 'Additional Info', 'woocommerce' ),
'priority' => 1,
'callback' => 'rj_single_product_additional_tab_callback'
);

return $tabs;

}
function rj_single_product_additional_tab_callback() {

global $post,$product,$wpdb;
// your display content here
}

Comments

Popular posts from this blog

How to add a custom sorting or order by option on category archive or product archive page in woocommerce wordpress

How to create a custom wp_list_table and bulk action in wordpress

How to add image option in nav menu in wordpress