Additional custom tabs – Single Products
-
Hi,
We need to add additional custom tabs through the product to use HTML Blocks. We don’t want to use the Glodal tabs from the theme settings -> Single Product ->tabs.
Also, if we use a plugin for custom tabs, can we change the order of your 2 tabs (created from within the product)?
Kind regards
Hi alexgeo,
Thanks for reaching to us.
1. You can edit product > scroll down to Product Setting > select Tabs tab and assign HTML Block https://prnt.sc/eZapBKMUTi7D
Please refer to documentation for more details https://xtemos.com/docs-topic/html-blocks-usage/
2. Use the below code for reordering the tabs, just set priority values per your needs. Paste the code into 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'] = 5; // Reviews first
$tabs['description']['priority'] = 10; // Description second
$tabs['additional_information']['priority'] = 15; // Additional information third
// Custom Tabs are from Product Settings
// $tabs['wd_custom_tab']['priority'] = 2;
// $tabs['wd_custom_tab_2']['priority'] = 3;
// Additional Tabs are from Theme Settings
// $tabs['wd_additional_tab']['priority'] = 4;
// $tabs['wd_additional_tab_2']['priority'] = 5;
return $tabs;
}
Regards,