Adds offerCount to variable product's structured data

This commit is contained in:
Claudio Sanches 2019-04-17 14:00:37 -03:00
parent c552d43522
commit 669542ed7d
1 changed files with 4 additions and 3 deletions

View File

@ -236,6 +236,7 @@ class WC_Structured_Data {
'@type' => 'AggregateOffer', '@type' => 'AggregateOffer',
'lowPrice' => wc_format_decimal( $lowest, wc_get_price_decimals() ), 'lowPrice' => wc_format_decimal( $lowest, wc_get_price_decimals() ),
'highPrice' => wc_format_decimal( $highest, wc_get_price_decimals() ), 'highPrice' => wc_format_decimal( $highest, wc_get_price_decimals() ),
'offerCount' => count( $product->get_children() ),
); );
} }
} else { } else {