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

@ -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 {