Only add schema for ratings when enabled.
This commit is contained in:
parent
4d4524c09d
commit
3265f594d8
|
@ -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(),
|
||||
|
|
Loading…
Reference in New Issue