Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › not display tab description when empty
- This topic has 3 replies, 2 voices, and was last updated 4 years, 6 months ago by Sarmistha Chakraborty.
- AuthorPosts
- May 2, 2020 at 4:44 am #125587aurelien_boutillierParticipant
Hello,
Sometimes, the vendor fill in only the short description but not the description.
When the description is empty, the tab is displayed without the title of the tab.I would like to not display the tab at all when the description is empty.
Is it possible ?Attached, a screeshot of the tab when the description is filled in, and a screenshot when the description is empty.
Thanks
AurélienAttachments:
You must be logged in to view attached files. - May 3, 2020 at 10:01 pm #126193Sarmistha ChakrabortyMember
Hello,
Try this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/// Remove Empty Tabs add_filter( 'woocommerce_product_tabs', 'wcfm_woo_remove_empty_tabs', 20, 1 ); function wcfm_woo_remove_empty_tabs( $tabs ) { if ( ! empty( $tabs ) ) { foreach ( $tabs as $title => $tab ) { if ( empty( $tab['content'] ) && strtolower( $tab['title'] ) !== 'description' ) { unset( $tabs[ $title ] ); } } } return $tabs; }
Thanks.
- May 3, 2020 at 10:34 pm #126203aurelien_boutillierParticipant
Hello Sarmistha Chakraborty,
Thank you for your return !
It doesn’t work.
The display of the description tab with this snippets is always empty even if there is a text inside.
The title of the tab is also empty.
cf. screenshot. Normally, there is a text inside the description tab on this product.Aurélien.
Attachments:
You must be logged in to view attached files.- May 4, 2020 at 2:59 pm #126429Sarmistha ChakrabortyMember
Hi,
Please check once this description tab, to activate WordPress default theme.
Thanks.
- AuthorPosts
- You must be logged in to reply to this topic.