Hiding A Tab If No Child Content

Hi,

Is there a way to hide a CS tab using conditions, if the tab has no child content? This is for the Tab (Elements) element.

I have several tabs (e.g. Description, Nutritional Information, Additional Information, Reviews). In some cases a product’s Nutritional Information tab may not have any content and I would like the tab to be hidden in this scenario.

However, this tab will contain Components, hidden by conditions, so they only show for the correct product. The Component condition is Product (Specific) Is <Product Name>.

Thanks,
Christopher

Hey Christopher,

Thanks for writing in! How do you add the “Nutritional Information”? Is it a custom field or a group of fields? Could you please provide one sample product that has “Nutritional Information” and another one that do not have any?

Cheers.

Hi Ruenel,

The related product is detailed in the first hyperlink in the secure note. Copy in a new SN.

Thanks,
Christopher

Hello Christopher,

When I edit your product, I do not see where the Nutritional Information is added. It seems that it is only added via Cornerstone. This will not work when working with the Woo Single layout. Your only option is to use the same condition you are using with the Component which is the “Product(specific) IS Nature’s Rewards…”

  • See the secure note below

Hope this makes sense.

Hi Ruenel,

I think I explained things badly and added confusion with the comparison.

In the Woocommerce Single Layout (see Secure Note), if the tab has no content for a product, can it be hidden from display with a condition?

Thanks,
Christopher

Hello Christopher,

Yes, I totally get. The thing is that there should be a relation between the Nutritional Information and the product item. When the information is saved as a product meta information, we may be able to create a condition to show/hide the tab since we can easily determine that. If you are just simply editing the product using the Cornerstone builder and add that Nutritional Information, you’re only option is to add a condition some thing like:

Product(specific) IS product item name  1  OR
Product(specific) IS product item name  2  OR
Product(specific) IS product item name  3  OR
Product(specific) IS product item name  4  OR
Product(specific) IS product item name  5

Whereas, if you have a custom field that returns true or false for example, we can simply have 1 single condition like {{dc:post:meta field="nutri_info"}} IS true

Hope this makes sense.

Hi Ruenel,

It looks like the multiple conditions are the way I am going to have to deal with this.

Thank you for your help and advice,
Christopher

You are most welcome, Christopher.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.