marwah
marwah

Reputation: 81

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?

Upvotes: 2

Views: 1040

Answers (1)

7uc1f3r
7uc1f3r

Reputation: 29624

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 );

Upvotes: 2

Related Questions