Skip to content

Commit 21a72ca

Browse files
committed
MAGETWO-70329: [GITHUB] The rich snippets are giving a warning for the element price #7173
1 parent c85abb4 commit 21a72ca

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

app/code/Magento/GroupedProduct/view/base/templates/product/price/final_price.phtml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@ $minProduct = $block->getSaleableItem()
1717
->getMinProduct();
1818

1919
if ($minProduct) {
20+
$finalPrice = $minProduct->getPriceInfo()->getPrice('final_price');
21+
$finalPriceValue = $finalPrice->getAmount();
2022
$amountRender = $block->getRendererPool()
2123
->createAmountRender(
22-
$minProduct->getPriceInfo()->getPrice('final_price')->getAmount(),
24+
$finalPriceValue,
2325
$minProduct,
24-
$minProduct->getPriceInfo()->getPrice('final_price'),
26+
$finalPrice,
2527
['include_container' => true]
2628
);
29+
$currencyCode = $amountRender->getDisplayCurrencyCode();
30+
} else {
31+
$finalPriceValue = 0;
32+
$currencyCode = '';
2733
}
2834
?>
2935
<div class="price-box" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
@@ -32,4 +38,6 @@ if ($minProduct) {
3238
<span class="price-label"><?php /* @escapeNotVerified */ echo __('Starting at')?></span><?php echo $amountRender->toHtml();?>
3339
</p>
3440
<?php endif ?>
41+
<meta itemprop="price" content="<?php /* @noEscape */ echo $finalPriceValue; ?>" />
42+
<meta itemprop="priceCurrency" content="<?php /* @noEscape */ echo $currencyCode; ?>" />
3543
</div>

0 commit comments

Comments
 (0)