I have successfully added a "tab" to the product details page tabs for the extra fields. The problem is: the tab is always there, whether it is needed or not, the extra fields will not be used on all products, so I only want to show the tab if the extra fields have values in them.
Example: some products will have dimensions (extra field), on these products, I want the tab labeled "specifications" to appear with the other tabs (send to friend, customer feedback, etc.,).
other product will not have dimensions listed, but may have materials (another extra field) listed instead, in this case I still want to show the "specifications" tab.
but some products will have neither dimensions or materials, in this case I don't want the tab to appear at all.
I added the tab by editing include/product_tabs.php, the code I added is below.
I am assuming I need to add something else to the extra Fields sections to tell it to only display the "Specifications" tab if at least
one of the extra fields has a value in it, but I don't know what?
Any ideas anyone?
Code:
if ($active_modules['Extra_Fields']) {
$product_tabs[] = array(
'title' => func_get_langvar_by_name('lbl_specifications'),
'tpl' => 'modules/Extra_Fields/product.tpl',
'anchor' => 'specs'
);
}