Skip to content
Advertisement

Move “review tab” to position output of product sharing on WooCommerce single product page

I want to change the position of the “review tab” to the position below the share button on the right

I removed the default “review tab” with this code and it worked

add_filter( 'woocommerce_product_tabs', 'maarra_remove_reviews_tab', 9999 );
 
function maarra_remove_reviews_tab( $tabs ) {
   unset( $tabs['reviews'] );
   return $tabs;
}

But I don’t know how to re-add the “review tab” under the share button. Any advice?

Advertisement

Answer

To change the position of the “review tab” to the position output of product sharing.

You can use:

// Remove
function filter_woocommerce_product_tabs( $tabs ) {
    unset( $tabs['reviews'] );
    
    return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'filter_woocommerce_product_tabs', 100, 1 );

add_action( 'woocommerce_share', 'comments_template' );

OR

// Remove
function filter_woocommerce_product_tabs( $tabs ) {
    unset( $tabs['reviews'] );
    
    return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'filter_woocommerce_product_tabs', 100, 1 );

add_action( 'woocommerce_single_product_summary', 'comments_template', 61 );
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement