templates/application/catalog/product-block.html.twig line 1

Open in your IDE?
  1. <div class="item-product">
  2.     <a href="{{ documentUrl(product) }}" class="item-product__photo miniphoto" draggable="false">
  3.         <div class="miniphoto__list">
  4.             {% if product.oldPrice %}
  5.                 <span class="discount-percent">-{{ discountPercent(product.oldPrice, product.price) }}%</span>
  6.             {% endif %}
  7.             <div class="miniphoto__item active">
  8.                 {{ include('application/partial/picture.html.twig', {image: product.image, width: 270, height: 270}) }}
  9.             </div>
  10.             {% for image in product.images %}
  11.                 <div class="miniphoto__item">
  12.                     {{ include('application/partial/picture.html.twig', {image: image, width: 270, height: 270}) }}
  13.                 </div>
  14.             {% endfor %}
  15.         </div>
  16.         <div class="miniphoto__over">
  17.             <div class="miniphoto__over-item active"></div>
  18.             {% for image in product.images %}
  19.                 <div class="miniphoto__over-item"></div>
  20.             {% endfor %}
  21.         </div>
  22.         {% if product.images|length > 0 %}
  23.             <div class="miniphoto__control">
  24.                 <div class="miniphoto__control-item active"></div>
  25.                 {% for image in product.images %}
  26.                     <div class="miniphoto__control-item"></div>
  27.                 {% endfor %}
  28.             </div>
  29.         {% endif %}
  30.         {% if product.hit or product.new %}
  31.             <div class="item-product__label">
  32.                 {% if product.hit %}
  33.                     <span class="item-label bg--primary">ХИТ</span>
  34.                 {% endif %}
  35.                 {% if product.new %}
  36.                     <span class="item-label bg--info">Новинка</span>
  37.                 {% endif %}
  38.             </div>
  39.         {% endif %}
  40.     </a>
  41.     <div class="item-product__title"><a href="{{ documentUrl(product) }}">{{ product.name(app.request.locale) }}</a></div>
  42.     {% set validPrice = cart.validPrice(product) %}
  43.     <div class="item-product__price">
  44.         {% if validPrice != product.price %}
  45.             {% if validPrice %}
  46.                 <div class="price">
  47.                     <span class="price__title">опт.</span>
  48.                     <span class="price__value {% if product.oldPrice %}with-discount{% endif %}">{{ validPrice|number_format(2, '.', ' ') }}</span>
  49.                     <span class="price__unit">₽ за шт.</span>
  50.                     {% if product.oldPrice %}
  51.                         <span class="price__value-old">{{ product.oldPrice|number_format(2, '.', ' ') }}</span>
  52.                     {% endif %}
  53.                     <span class="price__unit">₽</span>
  54.                 </div>
  55.             {% else %}
  56.                 <span class="price__title">опт. Невозможно рассчитать индивидуальную цену</span>
  57.             {% endif %}
  58.         {% endif %}
  59.         <div class="price">
  60.             {% if validPrice != product.price %}
  61.                 <span class="price__title">ррц.</span>
  62.             {% endif %}
  63.             <span class="price__value {% if product.oldPrice %}with-discount{% endif %}">{{ product.price|number_format(2, '.', ' ') }}<span class="price__unit"> ₽ / шт.</span></span>
  64.                 {% if product.oldPrice %}
  65.                     <span class="price__value-old">{{ product.oldPrice|number_format(2, '.', ' ') }} ₽</span> 
  66.                 {% endif %}
  67.         </div>
  68.     </div>
  69.     {% if product.quantity %}
  70.         <div class="item-product__stock stock">
  71.             В наличии {% if cart.counterpartyId %}{{ product.quantity }} шт.{% endif %}
  72.         </div>
  73.     {% else %}
  74.         <div class="item-product__stock stock disabled">
  75.             Нет в наличии
  76.         </div>
  77.     {% endif %}
  78.     {% if product.color %}
  79.     <div class="item-product__color color">
  80.         {% if product.color.image %}
  81.             <span class="color__photo"><img src="{{ resizeImage(product.color.image, 20, 20) }}" width="20" height="20" alt=""></span>
  82.         {% endif %}
  83.         {{ product.color.name(app.request.locale) }}
  84.     </div>
  85.     {% endif %}
  86.     {% if product.quantity %}
  87.         {{ include('application/catalog/add-to-cart-block.html.twig') }}
  88.     {% endif %}
  89. </div>