Ghost reviews
-
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. Frankadd_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)
Viewing 1 replies (of 1 total)
- The topic ‘Ghost reviews’ is closed to new replies.