templates/Slivki/mobile/delivery/delivery_teaser.html.twig line 1

Open in your IDE?
  1. {% set sosediCertificateTwentyRublesId = 3178 %}
  2. {% set sosediCertificateFiftyRublesId = 3179 %}
  3. {% set sosediCertificateHundredRublesId = 3180 %}
  4. <div name="{{ dish.id }}" class="delivery-teaser delivery-teaser-item-products mb-2 py-2 border-0 px-2 {% if dish.freeCodesCount is defined and not dish.freeCodesCount %}disabled{% endif %}">
  5.     <input class="d-none free-codes-count" value="{{ dish.freeCodesCount is defined ? dish.freeCodesCount }}"/>
  6.     <div class="row no-gutters mb-0">
  7.         <div class="col-auto">
  8.             <a href="#" class="show-delivery-details">
  9.                 <div class="delivery-teaser--img position-relative" style="background-image: url('{{ dish.imageURL }}')"></div>
  10.             </a>
  11.         </div>
  12.         <div class="col pl-2">
  13.             <div class="d-flex justify-content-between mb-3">
  14.                 <div class="d-flex">
  15.                     {% if isTop is defined and isTop %}
  16.                         <div class="delivery-sales-medal"></div>
  17.                     {% endif %}
  18.                     {% if dish.purchaseCount is defined %}
  19.                         <div class="d-flex justify-content-between align-items-center">
  20.                             <img class="delivery-sales-icon" src="/images/delivery-sales-icon-black.svg" alt="delivery-sales-icon">
  21.                             <p class="delivery-sales">{{ dish.purchaseCount }}</p>
  22.                         </div>
  23.                     {% endif %}
  24.                     {% if dish.rating is defined %}
  25.                         <div class="d-flex justify-content-between align-items-center mx-1">
  26.                             <img class="mr-1" width="15" height="15" src="/images/order_page/rating.svg">
  27.                             <p class="delivery-rating">{{ dish.rating }}</p>
  28.                         </div>
  29.                     {% endif %}
  30.                 </div>
  31.                 {% set discount = calcDishDiscount(dish.regularPrice, dish.offerPrice) %}
  32.                 {% if hasSosediPurchaseForUser is defined and (hasSosediPurchaseForUser == false and dish.id == sosediCertificateTwentyRublesId or hasSosediPurchaseForUser == false and dish.id == sosediCertificateHundredRublesId) %}
  33.                     {% set discount = 10 %}
  34.                 {% endif %}
  35.                 {% if discount > 0 %}
  36.                     <div class="delivery-discount" data-discount="-{{ discount }}">-{{ discount }}%</div>
  37.                 {% endif %}
  38.             </div>
  39.             <div class="dish-name font-size-1000 font-600 mb-0">{{ dish.name }}</div>
  40.             <span class="delivery-teaser--volume dish-weight">
  41.                         {% if dish.sizeFull %}
  42.                             {{ dish.sizeFull|raw }}
  43.                         {% endif %}
  44.                     </span>
  45.             {% if dish.fastDelivery is defined %}
  46.                 <div class="d-flex delivery-time-wrapp" style="display: none">
  47.                     <div class="rounded-14 bg-orange d-flex align-items-center px-2 my-2">
  48.                         <i class="fa fa-clock-o text-white mr-2" aria-hidden="true"></i>
  49.                         <p class="text-white mb-0">{{ dish.fastDelivery.time }} {{ dish.fastDelivery.text }}</p>
  50.                     </div>
  51.                 </div>
  52.             {% endif %}
  53.             {% if dish.pricePerKilogram is defined and dish.pricePerKilogram is not null %}
  54.                 <div class="js-price-per-kilogram sf-font opacity-06 justify-content-left my-2 row pl-3 d-none">
  55.                     <img alt="" src="/images/weight.svg"/>
  56.                     <p class="mb-0 ml-2 align-self-center"><span id="pricePerKilogramP">{{ dish.pricePerKilogram|number_format(2,',') }}</span>&nbsp;р&nbsp;/&nbsp;кг</p>
  57.                 </div>
  58.             {% endif %}
  59.         </div>
  60.     </div>
  61.     <div class="col px-0 d-flex position-absolute-food-block">
  62.         <div class="d-flex col px-0 pt-2">
  63.             <div class="d-flex align-items-center h-100">
  64.                 <del><span class="delivery-old-price mr-2">{{ dish.regularPrice|number_format(2,',') }}&nbsp;р</span></del>
  65.                 <span class="delivery-price font-weight-bold">
  66.                  {% if hasSosediPurchaseForUser is defined (hasSosediPurchaseForUser == false and dish.id == sosediCertificateTwentyRublesId or hasSosediPurchaseForUser == false and dish.id == sosediCertificateHundredRublesId) %}
  67.                      {{ dish.regularPrice|number_format(2,',') -  dish.regularPrice|number_format(2,',')/100*10 }}&nbsp;р
  68.                  {% else %}
  69.                      {{ dish.offerPrice|number_format(2,',') }}&nbsp;р
  70.                  {% endif %}
  71.                 </span>
  72.             </div>
  73.             {% if dish.freeCodesCount is defined and not dish.freeCodesCount %}
  74.                 <div class="col">
  75.                     <div class="sf-text-font font-size-1125 font-800 text-uppercase text-right" style="padding-right: 30px;">Продано</div>
  76.                 </div>
  77.             {% else %}
  78.                 {% if isAvailableOnFood is not defined or not isAvailableOnFood %}
  79.                     <div class="col quantity-item">
  80.                         {% include 'Slivki/delivery/quantity_select.html.twig' with {'isMobile': true} %}
  81.                     </div>
  82.                 {% endif %}
  83.             {% endif %}
  84.         </div>
  85.     </div>
  86.     <div class="dish-description d-none">{{ (dish.description ~ getDishNutrients(dish))|raw }}</div>
  87. </div>