Plugin Support
rm19
(@rm19)
Hii @arumugamact,
There is no direct hook in this case, but you have add following snippet on your child theme or snippet plugin to hide Q&A tab.
function custom_body_classes($classes) {
if (is_product()) {
$product = wc_get_product();
$productId = $product->get_id();
$all_questions = get_post_meta($productId, 'ets_question_answer', true);
if (empty($all_questions)) {
$classes[] = 'remove_qa_tab';
}
}
return $classes;
}
add_filter('body_class', 'custom_body_classes',999);
Plugin Support
rm19
(@rm19)
Dear @arumugamact,
If you can’t do the CSS, here is the complete snippet with CSS which will hide the tab.
function custom_body_classes($classes) {
if (is_product()) {
$product = wc_get_product();
$productId = $product->get_id();
$all_questions = get_post_meta($productId, 'ets_question_answer', true);
if (empty($all_questions)) {
$classes[] = 'remove_qa_tab';
}
}
return $classes;
}
add_filter('body_class', 'custom_body_classes');
function add_custom_css_to_head() {
echo '<style>
body.remove_qa_tab .tabs .ask_tab {
display: none;
}
</style>';
}
add_action('wp_head', 'add_custom_css_to_head');
Dear @arumugamact ,
I am reaching out to inform you that I will be closing this topic now due to inactivity.
As we have not received any response or update from you for more than 2 months, we assume that the topic has been resolved or is no longer a concern.
If you have any further questions or concerns, please do not hesitate to create a new topic. We would be happy to assist you further.
Thank you for bringing this to our attention, and we appreciate your interest in our WordPress plugin.
Best Regards,
Sunny