{% set imgs = [] %}
{% if collection.interiors is defined %}
{% for int in collection.interiors %}
{% set imgs = imgs | merge(['"' ~ int.pathImg ~ '"']) %}
{% endfor %}
{% endif %}
{% if collection.interiorsSuitable is defined %}
{% for int in collection.interiorsSuitable %}
{% set imgs = imgs | merge(['"' ~ int.pathImg ~ '"']) %}
{% endfor %}
{% endif %}
{% set availability = 'https://schema.org/InStock' %}
{% if collection.msg %}
{% set availability = 'https://schema.org/Discontinued' %}
{% endif %}
{% set settings = collection.settingsReact %}
{% set materials = '' %}
{% if settings is defined and settings.material is defined and settings.material.list is defined %}
{% for curMaterial in settings.material.list %}
{% set materials = materials ~ curMaterial.name %}
{% if not loop.last %}
{% set materials = materials ~ ', ' %}
{% endif %}
{% endfor %}
{% endif %}
{% set customerName = 'Customer' %}
{% apply spaceless %}
<script type="application/ld+json" rel="no">
{
"@context": "https://schema.org/",
"@type": "Product",
"mpn": "{{ collection.id }}",
"sku": "{{ collection.code }}",
"name": "{{ collection.header | striptags('') }}",
{% if imgs | length > 1 %}
"image": [{{ imgs | join(', ') | raw }}],
{% else %}
"image": {{ imgs | first | raw }},
{% endif %}
"description": "{{ meta.specs | raw }}",
"countryOfOrigin": "{{ collection.factory.country.alias }}",
"brand": {
"@type": "Brand",
"name": "{{ collection.factory.ActualName }}"
},
"material": "{{ materials }}",
"offers": {
"@type": "Offer",
"priceCurrency": "{{ userCurrency() }}",
"price": "{{ prMin(collection, {'currency': te.locale.getCur(), 'country': te.locale.getCurCountry()}) }}",
"itemCondition": "https://schema.org/NewCondition",
"availability": "{{ availability }}",
"seller": {
"@type": "Organization",
"name": "Tile.Expert"
},
"url": "{{ app.request.getSchemeAndHttpHost() ~ path('app_collection', {'factoryUrl': collection.factory.url, 'collectionUrl': collection.url}) }}"
}
{% if collection.reviews is defined and collection.reviews.count > 0 %}
,"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "{{ collection.reviews.percent.d }}",
"reviewCount": "{{ collection.reviews.count }}",
"bestRating": "5"
},
"review": [
{% for k,review in collection.reviews.list %}
{% if k != 0 %},{% endif %}
{% if review.username is defined and review.username %}
{% set customerName = review.username %}
{% endif %}
{
"@type": "Review",
"author": {
"@type": "Person",
"name": "{{ customerName }}"
},
"datePublished": "{{ review.date | date('Y-m-d') }}",
"description": "{{ review.content }}",
"reviewRating": {
"@type": "Rating",
"ratingValue": "{{ review.star }}",
"bestRating": "5",
"worstRating": "1"
}
}
{% endfor %}
]
{% endif %}
}
</script>
{% endapply %}