Answer the question
In order to leave comments, you need to log in
How to display only reviews in woocommerce tabs?
How to make it so that it would display only reviews without additional information?
<div class="woocommerce-product__tabs woocommerce-tabs wc-tabs-wrapper tabs">
<div class="woocommerce-product__tabs-links">
<div class="woocommerce-product__tab product-tab__active">1</div>
<div class="woocommerce-product__tab">2</div>
<div class="woocommerce-product__tab">3</div>
<div class="woocommerce-product__tab">4</div>
<div class="woocommerce-product__tab">5</div>
</div>
<div class="woocommerce-product__tabs-wrapper">
<div class="woocommerce-product__tab-item"><?php the_field( 'characteristics' ); ?></div>
<div class="woocommerce-product__tab-item"><?php the_field( 'complete_set' ); ?></div>
<div class="woocommerce-product__tab-item"><?php the_field( 'review' ); ?></div>
<div class="woocommerce-product__tab-item"><?php the_field( 'recipes' ); ?></div>
<?php foreach ( $product_tabs as $key => $product_tab ) : ?>
<div class="woocommerce-product__tab-item woocommerce-Tabs-panel woocommerce-Tabs-panel--<?php echo esc_attr( $key ); ?> panel entry-content wc-tab" id="tab-<?php echo esc_attr( $key ); ?>" role="tabpanel" aria-labelledby="tab-title-<?php echo esc_attr( $key ); ?>">
<?php
if ( isset( $product_tab['callback'] ) ) {
call_user_func( $product_tab['callback'], $key, $product_tab );
}
?>
</div>
<?php endforeach; ?>
</div>
<?php do_action( 'woocommerce_product_after_tabs' ); ?>
</div>
<?php foreach ( $product_tabs as $key => $product_tab ) : ?>
<div class="woocommerce-product__tab-item woocommerce-Tabs-panel woocommerce-Tabs-panel--<?php echo esc_attr( $key ); ?> panel entry-content wc-tab" id="tab-<?php echo esc_attr( $key ); ?>" role="tabpanel" aria-labelledby="tab-title-<?php echo esc_attr( $key ); ?>">
<?php
if ( isset( $product_tab['callback'] ) ) {
call_user_func( $product_tab['callback'], $key, $product_tab );
}
?>
</div>
<?php endforeach; ?>
Answer the question
In order to leave comments, you need to log in
Using the woocommerce_product_tabs hook -
add to functions.php:
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] );
unset( $tabs['additional_information'] );
return $tabs;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question