I'm using WooCommerce plugin under WordPress platform, and I'm trying to change the default tab in single-product.php page.
So right now I'm having the second tab active, I want to change the first tab to become the default active tab.
I have changed priority using woocommerce_product_tabs filter hook like that:
add_filter('woocommerce_product_tabs', function($tabs) {
global $post, $product; // Access to the current product or post
$custom_tab_title = get_field('props', $post->ID);
$tabs['reviews']['priority'] = 10;
if (!empty($custom_tab_title)) {
$tabs['awp-' . sanitize_title('props')] = [
'title' => 'אביזרים',
'callback' => 'awp_custom_woocommerce_tabs',
'priority' => 5
];
}
return $tabs;
});
And I have also tried changing it using jQuery basing on class active like this:
jQuery(document).ready(function($){
console.log( "ready!" );
jQuery('.reviews_tab').removeClass('active');
jQuery('#tab-title-awp-props').addClass('active');
});
Nothing worked so far.
How can I change default active tab in WooCommerce single product page?