Home Forums WoodMart support forum Reviews Reply To: Reviews

#467469

Hello,

Our developers have checked and see you have imported the comments incorrectly.

You need to import the comments correctly, then add this custom code to functions.php of the child theme:

add_filter( 'woocommerce_product_get_rating_counts', function ( $ratings ) {
	if ( ! $ratings || ! is_array( $ratings ) ) {
		return $ratings;
	}

	$new_ratings = array();

	foreach ( $ratings as $index => $rating ) {
		$new_ratings[ (int) $index ] = $rating;
	}

	return $new_ratings;
});

Best Regards