Reorder product tabs (custom & global)
-
Hi,
On a product page custom product tabs are shown under the global tabs (additional tabs created in theme settings). We would like to show the custom tabs first (created in product page settings). Could you please explain how to reorder them?
Hello designmono,
First of all, I’m really sorry have taken long time to reply you due to the weekend.
The code below will help you to reorder the tabs. Please try to add the code below in the functions.php file in your child theme.
/**
* Reorder product data tabs
*/
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
$tabs['reviews']['priority'] = 33; // Reviews first
$tabs['description']['priority'] = 4; // Description second
$tabs['additional_information']['priority'] = 5; // Additional information third
// Additional Tabs are from Theme Settings
$tabs['wd_additional_tab']['priority'] = 1;
$tabs['wd_additional_tab_2']['priority'] = 2;
return $tabs;
}
Kind Regards,