Only add schema for ratings when enabled.

This commit is contained in:
Mike Jolley 2018-03-08 13:03:58 +00:00
parent 4d4524c09d
commit 3265f594d8
1 changed files with 1 additions and 1 deletions

View File

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