templates/block/razmetka.html.twig line 1

Open in your IDE?
  1. <div style="position: absolute; top: -5000px; height: 1px; overflow: hidden;">
  2.     <script type="application/ld+json">
  3.         {
  4.             "@context": "https://schema.org/",
  5.             "@type": "HobbyShop",
  6.             "name": "{{ sett.get('sitename')|raw }}",
  7.             "address": {
  8.                 "@type": "PostalAddress",
  9.                 "streetAddress": "{{ sett.get('address')|raw }}",
  10.                 "addressLocality": "{{ sett.get('city')|raw }}",
  11.                 "addressRegion": "",
  12.                 "postalCode": "{{ sett.get('zipcode')|raw }}"
  13.             },
  14.             "image": "{{ sett.get('logo')|raw }}",
  15.             "email": "{{ sett.get('stuffemail')|raw }}",
  16.             "telephone": "{{ sett.get('phone')|raw }}",
  17.             "url": "https://{{ http_host }}",
  18.             "paymentAccepted": [ "cash", "credit card" ],
  19.             "openingHours": "Mo,Tu,We,Th,Fr,Sa,Su 00:00-23:59",
  20.             "geo": {
  21.                 "@type": "GeoCoordinates",
  22.                 "latitude": "{{ sett.get('geo_latitude')|raw }}",
  23.                 "longitude": "{{ sett.get('geo_longitude')|raw }}"
  24.             },
  25.             "priceRange": "$"
  26.         }
  27.     </script>
  28.     {% if args[0] == 'catalog' and cat and prod is empty %}
  29.         {% set minprice = 99999999999 %}
  30.         {% set maxprice = 0 %}
  31.         {% for prod in prods %}
  32.             {% if prod.price and prod.price < minprice and prod.num > 0%}
  33.                 {% set minprice = prod.price %}
  34.             {% endif %}
  35.             {% if prod.price2 and prod.price2 < minprice and prod.num2 > 0 %}
  36.                 {% set minprice = prod.price2 %}
  37.             {% endif %}
  38.             {% if prod.price3 and prod.price3 < minprice and prod.num3 > 0 %}
  39.                 {% set minprice = prod.price3 %}
  40.             {% endif %}
  41.             {% if prod.price and prod.price > maxprice and prod.num > 0 %}
  42.                 {% set maxprice = prod.price %}
  43.             {% endif %}
  44.             {% if prod.price2 and prod.price2 > maxprice and prod.num2 > 0 %}
  45.                 {% set maxprice = prod.price2 %}
  46.             {% endif %}
  47.             {% if prod.price3 and prod.price3 > maxprice and prod.num3 > 0 %}
  48.                 {% set maxprice = prod.price3 %}
  49.             {% endif %}
  50.         {% endfor %}
  51.         <div itemscope itemtype="https://schema.org/Product">
  52.             <meta itemprop="name" content="{{ page.name }}" />
  53.             <link itemprop="image" href="{{ asset(env.host_static ~ '/pic/cat/' ~ cat.id ~ '.jpg') }}" />
  54.             <meta itemprop="description" content="{{ page.descr }}" />
  55.             <div itemtype="https://schema.org/AggregateOffer" itemscope="" itemprop="offers">
  56.                 <meta content="{{ cnt }}" itemprop="offerCount">
  57.                 <meta content="{{ maxprice|fmtmoney }}" itemprop="highPrice">
  58.                 <meta content="{{ minprice|fmtmoney }}" itemprop="lowPrice">
  59.                 <meta content="{{ sett.get('valuta_code')|raw }}" itemprop="priceCurrency">
  60.             </div>
  61.         </div>
  62.     {% endif %}
  63.     {% if args[0] == 'catalog' and prod %}
  64.         <div itemscope itemtype="https://schema.org/Product">
  65.             <span itemprop="name">{{ prod.name }}</span>
  66.             <link itemprop="image" href="{{ asset(env.host_static ~ '/pic/prod-l/' ~ prod.id ~ '.jpg') }}" />
  67.             <div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
  68.                 <link itemprop="url" href="https://{{ http_host }}/catalog/prod-{{ prod.id }}" />
  69.                 <meta itemprop="priceCurrency" content="{{ sett.get('valuta_code')|raw }}" />
  70.                 <span itemprop="price" content="{{ prod.price|fmtmoney }}">{{ prod.price|fmtmoney }}</span>
  71.                 <link itemprop="availability" href="https://schema.org/InStock" />
  72.             </div>
  73.             <span itemprop="description">{{ page.descr }}</span>
  74.             {% if comments is not empty %}
  75.                 <div itemprop="review" itemscope itemtype="https://schema.org/Review">
  76.                     {% for comment in comments %}
  77.                         <span itemprop="name">{{ labels.get('razmetka-1')|raw }}</span>
  78.                         {{ labels.get('razmetka-2')|raw }} <span itemprop="author">{{ comment.author }}</span>,
  79.                         <meta itemprop="datePublished" content="{{ comment.tstamp|date('Y-m-d') }}">
  80.                         <span itemprop="description">{{ comment.cont }}</span>
  81.                     {% endfor %}
  82.                 </div>
  83.             {% endif %}
  84.         </div>
  85.     {% endif %}
  86.     {% if bc|length %}
  87.         {% set i = 0 %}
  88.         <ol itemscope itemtype="https://schema.org/BreadcrumbList">
  89.             {% for l, t in bc %}
  90.                 <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
  91.                     <a itemprop="item" href="{{ env.host_static ~ l }}">
  92.                         <span itemprop="name">{{ t|replace({'"': ''})|striptags }}</span></a>
  93.                     <meta itemprop="position" content="{% set i = i + 1 %}{{ i }}" />
  94.                 </li>
  95.             {% endfor %}
  96.         </ol>
  97.     {% endif %}
  98. </div>