Home › Forums › WoodMart support forum › product page custom tab orders › Reply To: product page custom tab orders
February 2, 2022 at 11:19 am
#349668
Elise Noromit
Member
Hello,
The Woocommerce gives this code:
/**
* Reorder product data tabs
*/
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
$tabs['reviews']['priority'] = 5; // Reviews first
$tabs['description']['priority'] = 10; // Description second
$tabs['additional_information']['priority'] = 15; // Additional information third
return $tabs;
}
You need to take the tab class and set the order: https://gyazo.com/d9e2224a5947d1baa627a2cb79dc4edb
/**
* Reorder product data tabs
*/
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
$tabs['description_tab']['priority'] = 5; // Description first
$tabs['wd_additional_tab_tab']['priority'] = 10; //Additional information custom tab second
$tabs['INSERT THE TAB CLASS HERE']['priority'] = 15; // DESCRIBE THE TAB HERE
return $tabs;
}
Please find this line: $tabs['INSERT THE TAB CLASS HERE']['priority'] = 15; // DESCRIBE THE TAB HERE
insert the tab class, change 15 to 20, then 25, then 30 for each tab and set the order for each tab from your product page.
Best Regards