Skip to content

Commit 2b7c936

Browse files
committed
Shorten
1 parent 19ed54c commit 2b7c936

File tree

1 file changed

+7
-5
lines changed
  • app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph

1 file changed

+7
-5
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66

77
/** @var $block \Magento\Catalog\Block\Product\View */
88
/** @var $escaper \Magento\Framework\Escaper */
9+
10+
$product = $block->getProduct();
911
?>
1012

1113
<meta property="og:type" content="product" />
1214
<meta property="og:title"
13-
content="<?= $escaper->escapeHtmlAttr($block->stripTags($block->getProduct()->getName())) ?>" />
15+
content="<?= $escaper->escapeHtmlAttr($block->stripTags($product->getName())) ?>" />
1416
<meta property="og:image"
15-
content="<?= $escaper->escapeUrl($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()) ?>" />
17+
content="<?= $escaper->escapeUrl($block->getImage($product, 'product_base_image')->getImageUrl()) ?>" />
1618
<meta property="og:description"
17-
content="<?= $escaper->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?>" />
18-
<meta property="og:url" content="<?= $escaper->escapeUrl($block->getProduct()->getProductUrl()) ?>" />
19-
<?php if ($block->getProduct()->getCanShowPrice() !== false && $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
2022
->getPriceInfo()
2123
->getPrice(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE)
2224
->getAmount()):?>

0 commit comments

Comments
 (0)