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 1
1
<?php
2
2
/**
3
- * Copyright 2014 Adobe
3
+ * Copyright 2011 Adobe
4
4
* All Rights Reserved.
5
5
*/
6
6
7
7
/** @var $block \Magento\Catalog\Block\Product\View */
8
+ /** @var $escaper \Magento\Framework\Escaper */
9
+
10
+ $ product = $ block ->getProduct ();
8
11
?>
9
12
10
13
<meta property="og:type" content="product" />
11
14
<meta property="og:title"
12
- content="<?= $ block ->escapeHtmlAttr ($ block ->stripTags ($ block -> getProduct () ->getName ())) ?> " />
15
+ content="<?= $ escaper ->escapeHtmlAttr ($ block ->stripTags ($ product ->getName ())) ?> " />
13
16
<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 ()) ?> " />
15
18
<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
19
22
->getPriceInfo ()
20
23
->getPrice (\Magento \Catalog \Pricing \Price \FinalPrice::PRICE_CODE )
21
24
->getAmount ()):?>
22
- <meta property="product:price:amount" content="<?= $ block ->escapeHtmlAttr ($ priceAmount ) ?> "/>
25
+ <meta property="product:price:amount" content="<?= $ escaper ->escapeHtmlAttr ($ priceAmount ) ?> "/>
23
26
<?= $ block ->getChildHtml ('meta.currency ' ) ?>
24
27
<?php endif ;?>
You can’t perform that action at this time.
0 commit comments