File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 11<?php
22/**
3- * Copyright 2014 Adobe
3+ * Copyright 2011 Adobe
44 * All Rights Reserved.
55 */
66
77/** @var $block \Magento\Catalog\Block\Product\View */
8+ /** @var $escaper \Magento\Framework\Escaper */
9+
10+ $ product = $ block ->getProduct ();
811?>
912
1013<meta property="og:type" content="product" />
1114<meta property="og:title"
12- content="<?= $ block ->escapeHtmlAttr ($ block ->stripTags ($ block -> getProduct () ->getName ())) ?> " />
15+ content="<?= $ escaper ->escapeHtmlAttr ($ block ->stripTags ($ product ->getName ())) ?> " />
1316<meta property="og:image"
14- content="<?= $ block ->escapeUrl ($ block ->getImage ($ block -> getProduct () , 'product_base_image ' )->getImageUrl ()) ?> " />
17+ content="<?= $ escaper ->escapeUrl ($ block ->getImage ($ product , 'product_base_image ' )->getImageUrl ()) ?> " />
1518<meta property="og:description"
16- content="<?= $ block ->escapeHtmlAttr ($ block ->stripTags ($ block -> getProduct () ->getShortDescription ())) ?> " />
17- <meta property="og:url" content="<?= $ block ->escapeUrl ($ block -> getProduct () ->getProductUrl ()) ?> " />
18- <?php if ($ priceAmount = $ block -> getProduct ()
19+ content="<?= $ escaper ->escapeHtmlAttr ($ block ->stripTags ($ product ->getShortDescription ())) ?> " />
20+ <meta property="og:url" content="<?= $ escaper ->escapeUrl ($ product ->getProductUrl ()) ?> " />
21+ <?php if ($ product -> getCanShowPrice () !== false && $ priceAmount = $ product
1922 ->getPriceInfo ()
2023 ->getPrice (\Magento \Catalog \Pricing \Price \FinalPrice::PRICE_CODE )
2124 ->getAmount ()):?>
22- <meta property="product:price:amount" content="<?= $ block ->escapeHtmlAttr ($ priceAmount ) ?> "/>
25+ <meta property="product:price:amount" content="<?= $ escaper ->escapeHtmlAttr ($ priceAmount ) ?> "/>
2326 <?= $ block ->getChildHtml ('meta.currency ' ) ?>
2427<?php endif ;?>
You can’t perform that action at this time.
0 commit comments