Reputation: 1
If anyone is able to help, I'd be so grateful. Small business owner here and my partner and I just have to figure this stuff ourselves right now. I am on Woocommerce- Divi Child Theme.
I want to override WooCommerce's default "tab" order (the menu bar under product pics that says "Description", Additional Info" and "Reviews")
I already added my own tab for "Recipes" and I need that to show first (already be loaded on the page without having to click the tab. After some Googling, adding this code in the functions.php file helped me get the "Recipes" tab to show first and display all the content without having to click on it:
/**
* Reorder product data tabs
*/
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
$tabs['recipes']['priority'] = 5; // Recipes first
$tabs['description']['priority'] = 10; // Description second
$tabs['reviews']['priority'] = 15; // Reviews third
$tabs['additional_information']['priority'] = 20; // Additional information fourth
return $tabs;
}
BUT now the issue is I have many product pages that will never have/need a "recipes" tab. So in those cases it just shows "Description", Additional Info" and "Reviews" however it hides the content under "Description now. And I need that content to automatically show. Any idea how I can fix this or is there something in the above CSS telling it to hide it unless clicked?
UPDATE ~~~~~~~~~ Here is a screenshot of the code from the plugin (it won't let me add the image since I'm new, but I think the iage link should work):
UPDATE: Here's actual live pages showing the issue: Here's a spice blend page where its displaying as we want (showing recipes as the first tab under the product pics): https://pinchspicemarket.com/product/buffys-slayer-helper/
and this is an example of a "basic spice" page where we don't have recipes/likely won't ever and we want the description tab to show instead with the full content displayed (but you have to click on it to view that content now): https://pinchspicemarket.com/product/cinnamon-powder-ceylon/
Upvotes: 0
Views: 1567
Reputation: 1069
So I did an install of that plugin and it looks like all you need to do is remove the Tab on the products you don't want it on.
They are assuming if you have a custom tab on a product that you intend to use it so don't bother to do a check if the content is empty.
Upvotes: 0