custom/static-plugins/EfbStorefront/Resources/views/storefront/page/product-detail/meta.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
  2. {% block layout_head_meta_tags_opengraph %}
  3.     <meta property="og:type"
  4.           content="product"/>
  5.     <meta property="og:site_name"
  6.           content="{{ config('core.basicInformation.shopName') }}"/>
  7.     <meta property="og:url"
  8.           content="{{ seoUrl('frontend.detail.page', { productId: page.product.id }) }}"/>
  9.     <meta property="og:title"
  10.           content="{{ metaTitle }}"/>
  11.     <meta property="og:description"
  12.           content="{{ metaDescription }}"/>
  13.     <meta property="og:image"
  14.           content="{{ page.product.cover.media.url }}"/>
  15.     {% if page.product.manufacturer %}
  16.         <meta property="product:brand"
  17.               content="{{ page.product.manufacturer.translated.name }}"/>
  18.     {% endif %}
  19.     {% set metaPrice = page.product.calculatedPrice %}
  20.     {% if page.product.calculatedPrices.count > 0 %}
  21.         {% set metaPrice = page.product.calculatedPrices.last %}
  22.     {% endif %}
  23.     {% if context.customer %}
  24.         <meta property="product:price:amount" content="{{ metaPrice.unitPrice|round(context.currency.itemRounding.decimals) }}"/>
  25.     {% endif %}
  26.     <meta property="product:price:currency"
  27.           content="{{ context.currency.isoCode }}"/>
  28.     <meta property="product:product_link"
  29.           content="{{ seoUrl('frontend.detail.page', { productId: page.product.id }) }}"/>
  30.     <meta name="twitter:card"
  31.           content="product"/>
  32.     <meta name="twitter:site"
  33.           content="{{ config('core.basicInformation.shopName') }}"/>
  34.     <meta name="twitter:title"
  35.           content="{{ metaTitle }}"/>
  36.     <meta name="twitter:description"
  37.           content="{{ metaDescription }}"/>
  38.     <meta name="twitter:image"
  39.           content="{{ page.product.cover.media.url }}"/>
  40. {% endblock %}
  41. {% block dreisc_seo__layout_head_meta_tags__ld_json %}
  42.     {# remove price from jsonld serp #}
  43.     {% set richSnippetDataStruct = page.extensions[constant('DreiscSeoPro\\Subscriber\\Installment\\RichSnippet\\RichSnippetSubscriber::DREISC_SEO_INSTALLMENT_RICH_SNIPPET_DATA')] %}
  44.     {% set modifiedRichSnippetDataStruct = [] %}
  45.     {% for snippet in richSnippetDataStruct.ldJson %}
  46.         {% if snippet['@type'] == 'Product' %}
  47.             {% set updated_offers = [] %}
  48.             {% for offer in snippet.offers %}
  49.                 {% set filtered_offer = offer|merge({'price': null}) %}
  50.                 {% set filtered_offer = filtered_offer|filter((key, value) => key != 'price') %}
  51.                 {% set updated_offers = updated_offers|merge([filtered_offer]) %}
  52.             {% endfor %}
  53.             {% set snippet = snippet|merge({'offers': updated_offers}) %}
  54.         {% endif %}
  55.         {% set modifiedRichSnippetDataStruct = modifiedRichSnippetDataStruct|merge([snippet]) %}
  56.     {% endfor %}
  57.     {% if modifiedRichSnippetDataStruct is not null %}
  58.         <script type="application/ld+json">
  59.             {{ modifiedRichSnippetDataStruct|json_encode|raw }}
  60.         </script>
  61.     {% endif %}
  62. {% endblock %}