{% if slider.type == 'a' %}
{% set curId = slider.elementId %}
{% set curElement = slider.elements[curId] %}
{% set curElementName = '' %}
{% if curElement.alternateName is defined and curElement.alternateName %}
{% set curElementName = curElement.alternateName %}
{% elseif curElement.name is defined and curElement.name %}
{% set curElementName = curElement.name %}
{% endif %}
{% set curElInitPrice = curElement.discountsAmount %}
{% if curElInitPrice is defined and curElInitPrice[0] is defined and curElInitPrice[0].price is defined %}
{% set pCount = 1 %}
{% if slider.measureGb %}
{% if curElement.packagingCountFt %}
{% set pCount = curElement.packagingCountFt %}
{% elseif curElement.packagingCount %}
{% set pCount = curElement.packagingCount %}
{% elseif curElement.packagingCountPC %}
{% set pCount = curElement.packagingCountPC %}
{% endif %}
{% else %}
{% if curElement.packagingCount %}
{% set pCount = curElement.packagingCount %}
{% elseif curElement.packagingCountPC %}
{% set pCount = curElement.packagingCountPC %}
{% endif %}
{% endif %}
{% set curPrice = (pCount * curElInitPrice[0].price) | floatSing %}
{% if userLocale() != 'en' %}
{% set curPrice = te.replaceStr('.', '', curPrice) %}
{% set curPrice = te.replaceStr(',', '.', curPrice) %}
{% else %}
{% set curPrice = te.replaceStr(',', '', curPrice) %}
{% endif %}
{% if userLocale() == 'ru' %}
{% set curPrice = te.replaceStr(' ', '', curPrice) %}
{% endif %}
{% set colors = '' %}
{% if curElement.colors is defined %}
{% for color in curElement.colors %}
{% set colors = colors ~ color.name %}
{% if not loop.last %}
{% set colors = colors ~ ', ' %}
{% endif %}
{% endfor %}
{% endif %}
{% set patterns = '' %}
{% if curElement.motivs is defined %}
{% for motiv in curElement.motivs %}
{% set patterns = patterns ~ motiv.name %}
{% if not loop.last %}
{% set patterns = patterns ~ ', ' %}
{% endif %}
{% endfor %}
{% endif %}
{% set availability = 'https://schema.org/InStock' %}
{% if slider.suspended %}
{% set availability = 'https://schema.org/OutOfStock' %}
{% endif %}
{% apply spaceless %}
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Product",
"mpn": "{{ curId }}",
"sku": "{{ curElement.code }}",
"name": "{{ curElementName }}",
"image": ["{{ te.replaceStr('\\', '/', curElement.pathImg) }}"],
"description": "{{ meta.description | raw }}",
"brand": {
"@type": "Brand",
"name": "{{ curElement.collection.factory.name }}"
},
"color": "{{ colors }}",
"material": "{{ curElement.material.name }}",
{% if curElement.motivs | length > 0 %}
"pattern": "{{ patterns }}",
{% endif %}
"width": "{{ curElement.width }}",
"height": "{{ curElement.height }}",
"offers": {
"@type": "Offer",
"priceCurrency": "{{ userCurrency() }}",
"price": "{{ curPrice }}",
"itemCondition": "https://schema.org/NewCondition",
"availability": "{{ availability }}",
"seller": {
"@type": "Organization",
"name": "Tile.Expert"
},
"url": "{{ app.request.uri }}"
}
}
</script>
{% endapply %}
{% endif %}
{% endif %}