silumantu
Member
- Oct 9, 2019
- 169
- 23
- 18
I have 5 tabs in my woocommerce site including additional information tabs plus 2 custom tabs created by my theme. I am using bellow snippet to reorder them in the single product page.
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
$tabs['description']['priority'] = 5; // Description first
$tabs['additional_information']['priority'] = 10; // Additional information second
$tabs['wd_additional_tab']['priority'] = 15; // custom tab by woodmart third
$tabs['wd_additional_tab_2']['priority'] = 20; // custom tab by woodmart fourth
$tabs['reviews']['priority'] = 25; // Reviews last
return $tabs;
}
The problem is when the additional information tab is empty, it shows a blank tab in the single product frontend. It is even happening without using the above snippet. I tried various snippet to solve this like this , this etc. but they are not working properly. Some are even completely hiding the additional information tab.
So is there any snippet to hide additional information tab when its content is empty?
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
$tabs['description']['priority'] = 5; // Description first
$tabs['additional_information']['priority'] = 10; // Additional information second
$tabs['wd_additional_tab']['priority'] = 15; // custom tab by woodmart third
$tabs['wd_additional_tab_2']['priority'] = 20; // custom tab by woodmart fourth
$tabs['reviews']['priority'] = 25; // Reviews last
return $tabs;
}
The problem is when the additional information tab is empty, it shows a blank tab in the single product frontend. It is even happening without using the above snippet. I tried various snippet to solve this like this , this etc. but they are not working properly. Some are even completely hiding the additional information tab.
So is there any snippet to hide additional information tab when its content is empty?