From 669542ed7db60aa81144842cdf83cec685f386f2 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Wed, 17 Apr 2019 14:00:37 -0300 Subject: [PATCH] Adds offerCount to variable product's structured data --- includes/class-wc-structured-data.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/class-wc-structured-data.php b/includes/class-wc-structured-data.php index e22e8c63d32..5bf06163be9 100644 --- a/includes/class-wc-structured-data.php +++ b/includes/class-wc-structured-data.php @@ -233,9 +233,10 @@ class WC_Structured_Data { ); } else { $markup_offer = array( - '@type' => 'AggregateOffer', - 'lowPrice' => wc_format_decimal( $lowest, wc_get_price_decimals() ), - 'highPrice' => wc_format_decimal( $highest, wc_get_price_decimals() ), + '@type' => 'AggregateOffer', + 'lowPrice' => wc_format_decimal( $lowest, wc_get_price_decimals() ), + 'highPrice' => wc_format_decimal( $highest, wc_get_price_decimals() ), + 'offerCount' => count( $product->get_children() ), ); } } else {