Merge pull request #23828 from Jon007/patch-1

Avoid outputting a rating of zero when product has comments without a review rating.
This commit is contained in:
Claudio Sanches 2019-06-18 15:51:55 -03:00 committed by GitHub
commit 96787d62f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -268,7 +268,7 @@ class WC_Structured_Data {
$markup['offers'] = array( apply_filters( 'woocommerce_structured_data_product_offer', $markup_offer, $product ) );
}
if ( $product->get_review_count() && wc_review_ratings_enabled() ) {
if ( $product->get_rating_count() && wc_review_ratings_enabled() ) {
$markup['aggregateRating'] = array(
'@type' => 'AggregateRating',
'ratingValue' => $product->get_average_rating(),