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
}
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
Post a Comment