• Resolved perlfan

    (@perlfan)


    Hi there,
    Hi there, I’m displaying the number of reviews behind the product names on the catalog page with the code below. However, I have a problem with duplicated products – these “inherit” the number of ratings from their original products. So even though these duplicated products have no ratings, $product->get_rating_count() results in a certain number of reviews (instead of 0). So how can I reset the review count to have the correct number of reviews displayed for all products? Thanks for help. Frank

    add_filter( 'woocommerce_product_get_rating_html', function ( $html, $rating, $count ) {
    	global $product;
    	if ( $html && is_archive() && $product) {
    		$html .= sprintf( '<span class="review-count"> (%s)</span>', $product->get_rating_count() );
    	}
    
    	return $html;
    }, 10, 3 );
Viewing 1 replies (of 1 total)
  • Plugin Author cusrev

    (@ivole)

    Thanks for getting in touch!

    As far as I understood, this question is not about our plugin but about standard reviews in WooCommerce.

    Please try to add a new review manually to the product with the problem and then delete it. It should reset pre-cached ratings in WooCommerce.

Viewing 1 replies (of 1 total)
  • The topic ‘Ghost reviews’ is closed to new replies.