How to move Woocommerce reviews from tabs to right column

After 4 or 5 hours of search I did not have a solution. The code didn’t work or worked only partially. Eventually, I had to study the file structure and look for differences between all the examples and the actual layout. As a result, I made a working code. Works with version 3.

First part puts reviews in right column after all traditional for Woocommerce parts.

Second part removes reviews from tabs.

function woocommerce_template_product_reviews() {
wc_get_template( ‘single-product-reviews.php’ );
}
add_action( ‘woocommerce_single_product_summary’, ‘comments_template’, 50 );

add_filter( ‘woocommerce_product_tabs’, ‘woo_remove_product_tabs’, 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs[‘reviews’] );
return $tabs;
}

Add a Comment

Ваша e-mail адреса не оприлюднюватиметься. Обов’язкові поля позначені *