diff --git a/src/BlockTypes/ProductTopRated.php b/src/BlockTypes/ProductTopRated.php index db3cfbc7b39..88503d0a49a 100644 --- a/src/BlockTypes/ProductTopRated.php +++ b/src/BlockTypes/ProductTopRated.php @@ -14,11 +14,17 @@ class ProductTopRated extends AbstractProductGrid { protected $block_name = 'product-top-rated'; /** - * Force orderby to rating. + * Show only products with ratings and order by rating. * * @param array $query_args Query args. */ protected function set_block_query_args( &$query_args ) { $query_args['orderby'] = 'rating'; + + $this->meta_query[] = array( + 'key' => '_wc_average_rating', + 'value' => 0, + 'compare' => '>', + ); } }