Merge pull request #18565 from woocommerce/fix/18558

Use only review count
This commit is contained in:
Claudiu Lodromanean 2018-01-23 08:08:43 -08:00 committed by GitHub
commit 3bfa3b29a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -254,11 +254,10 @@ class WC_Structured_Data {
$markup['offers'] = array( apply_filters( 'woocommerce_structured_data_product_offer', $markup_offer, $product ) );
}
if ( $product->get_rating_count() ) {
if ( $product->get_review_count() ) {
$markup['aggregateRating'] = array(
'@type' => 'AggregateRating',
'ratingValue' => $product->get_average_rating(),
'ratingCount' => $product->get_rating_count(),
'reviewCount' => $product->get_review_count(),
);
}

View File

@ -59,6 +59,7 @@
</rule>
<rule ref="Squiz.Commenting">
<exclude-pattern>tests/</exclude-pattern>
<exclude name="Squiz.Commenting.LongConditionClosingComment" />
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
<exclude-pattern>tests/e2e-tests/</exclude-pattern>