{% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}
{% block layout_head_meta_tags_opengraph %}
{{ parent() }}
{% set productReviewCount = page.product.extensions.rating.totalReviews %}
{% if productReviewCount > 0 %}
{% set productAvgRating = page.product.extensions.rating.rating|round(2, "common") %}
{% endif %}
{% set price = page.product.price.elements | first %}
{% set imageArray = [] %}
{% for image in page.product.media.elements %}
{% set imageArray = imageArray| merge([image.media.url]) %}
{% endfor %}
<script type="application/ld+json">
[{
"@context": "https://schema.org/",
"@type": "Product",
"name": "{{ page.product.translated.name }}",
"description": "{{ metaDescription }}",
"sku": "{{ page.product.productNumber }}",
"mpn": "{{ page.product.productNumber }}",
"brand": {
"@type": "Brand",
"name": "{{ page.product.manufacturer.name }}"
},
"offers": [
{
"@type": "Offer",
"availability": "https://schema.org/LimitedAvailability",
"itemCondition": "https://schema.org/NewCondition",
"price": "{{ price.gross }}",
"priceCurrency": "EUR",
"priceValidUntil": "{{ 'now'|date('d-m-Y') }}",
"url": "{{ page.extensions.dreiscSeoInstallmentRichSnippetData.ldJson[0].offers[0].url }}",
"shippingDetails": {
"@type": "OfferShippingDetails",
"shippingRate": {
"@type": "MonetaryAmount",
"value": "9.95",
"currency": "EUR"
},
"shippingDestination": [
{
"@type": "DefinedRegion",
"addressCountry": "DE"
}
],
"deliveryTime": {
"@type": "ShippingDeliveryTime",
"handlingTime": {
"@type": "QuantitativeValue",
"minValue": 0,
"maxValue": 1,
"unitCode": "DAY"
},
"transitTime": {
"@type": "QuantitativeValue",
"minValue": 1,
"maxValue": 2,
"unitCode": "DAY"
}
}
}
}
],
{% if productAvgRating > 0 and productReviewCount > 0 %}
{% for review in (page.product.extensions.reviews.all()|slice(0,1)) %}
"review": {
"@type": "Review",
"reviewRating": {
"@type": "Rating",
"ratingValue": "{{ review.stars }}",
"bestRating": 5
},
"author": {
"@type": "Person",
"name": "{% if review.reviewer %} {{ review.reviewer }} {% else %}anonym{% endif %}"
}
},
{% endfor %}
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "{{ productAvgRating }}",
"reviewCount": "{{ productReviewCount }}"
},
{% endif %}
"image": [
"{{ imageArray[0] }}",
"{{ imageArray[1] }}",
"{{ imageArray[2] }}"
]
},
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"item": "https://doncarne.de/{{ page.product.seoCategory.translated.externalLink }}",
"name": "{{ page.product.seoCategory.translated.name }}",
"position": 1
}
]
}]
</script>
{% endblock %}
{% block layout_head_title_inner %}
{% if page.metaInformation.metaTitle %}{{ page.metaInformation.metaTitle }}{% else %}{{ page.product.translated.name }}{% if page.product.variation %} - {% for variation in page.product.variation %}{{ variation.group }}: {{ variation.option }}{% if page.product.variation|last != variation %}{{ " | " }}{% endif %}{% endfor %}{% endif %}{% endif %}
{% endblock %}
{% block layout_head_canonical %}
{% set canonicalUrl = page.product.id %}
{% if page.product.canonicalProductId %}
{% set canonicalUrl = page.product.canonicalProductId %}
{% endif %}
<link rel="canonical" href="{{ seoUrl('frontend.detail.page', { productId: canonicalUrl }) }}" />
{% endblock %}