{% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
{% block layout_head_meta_tags_opengraph %}
<meta property="og:type"
content="product"/>
<meta property="og:site_name"
content="{{ config('core.basicInformation.shopName') }}"/>
<meta property="og:url"
content="{{ seoUrl('frontend.detail.page', { productId: page.product.id }) }}"/>
<meta property="og:title"
content="{{ metaTitle }}"/>
<meta property="og:description"
content="{{ metaDescription }}"/>
<meta property="og:image"
content="{{ page.product.cover.media.url }}"/>
{% if page.product.manufacturer %}
<meta property="product:brand"
content="{{ page.product.manufacturer.translated.name }}"/>
{% endif %}
{% set metaPrice = page.product.calculatedPrice %}
{% if page.product.calculatedPrices.count > 0 %}
{% set metaPrice = page.product.calculatedPrices.last %}
{% endif %}
{% if context.customer %}
<meta property="product:price:amount" content="{{ metaPrice.unitPrice|round(context.currency.itemRounding.decimals) }}"/>
{% endif %}
<meta property="product:price:currency"
content="{{ context.currency.isoCode }}"/>
<meta property="product:product_link"
content="{{ seoUrl('frontend.detail.page', { productId: page.product.id }) }}"/>
<meta name="twitter:card"
content="product"/>
<meta name="twitter:site"
content="{{ config('core.basicInformation.shopName') }}"/>
<meta name="twitter:title"
content="{{ metaTitle }}"/>
<meta name="twitter:description"
content="{{ metaDescription }}"/>
<meta name="twitter:image"
content="{{ page.product.cover.media.url }}"/>
{% endblock %}
{% block dreisc_seo__layout_head_meta_tags__ld_json %}
{# remove price from jsonld serp #}
{% set richSnippetDataStruct = page.extensions[constant('DreiscSeoPro\\Subscriber\\Installment\\RichSnippet\\RichSnippetSubscriber::DREISC_SEO_INSTALLMENT_RICH_SNIPPET_DATA')] %}
{% set modifiedRichSnippetDataStruct = [] %}
{% for snippet in richSnippetDataStruct.ldJson %}
{% if snippet['@type'] == 'Product' %}
{% set updated_offers = [] %}
{% for offer in snippet.offers %}
{% set filtered_offer = offer|merge({'price': null}) %}
{% set filtered_offer = filtered_offer|filter((key, value) => key != 'price') %}
{% set updated_offers = updated_offers|merge([filtered_offer]) %}
{% endfor %}
{% set snippet = snippet|merge({'offers': updated_offers}) %}
{% endif %}
{% set modifiedRichSnippetDataStruct = modifiedRichSnippetDataStruct|merge([snippet]) %}
{% endfor %}
{% if modifiedRichSnippetDataStruct is not null %}
<script type="application/ld+json">
{{ modifiedRichSnippetDataStruct|json_encode|raw }}
</script>
{% endif %}
{% endblock %}