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

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