Merge pull request #18565 from woocommerce/fix/18558
Use only review count
This commit is contained in:
commit
3bfa3b29a9
|
@ -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(),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue