webdev.ramyash@gmail.com

Web Development: March 2019


PHP, MySql, JQuery, Ajax,Wordpress,Woocommerce,HTML,CSS,JavaScript,DOM,jQuery,PHP,SQL,XML,Bootstrap,Web

Add woocommerce custom product tabs.

Add in your functions.php

add_filter( 'woocommerce_product_tabs', 'woocommerce_custom_product_tabs' );

function woocommerce_custom_product_tabs( $tabs ) {

 $tabs['courses_tab'] = array(
        'title'     => __( 'Courses', 'woocommerce' ), //Tab title
        'priority'  => 100, // Tab priority
        'callback'  => 'courses_tab_content' //callback function
    );
return $tabs;

  }

//callback function
function courses_tab_content() {
    echo '<h2>Courses</h2>';
    echo '<p>Courses tab.</p>';
}