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.         {% if dish.weight is defined and dish.weight != '' %}
  37.             <div class="small-description-item">{{ dish.weight }}</div>
  38.         {% endif %}
  39.     </div>
  40.     <div class="text-center px-2">
  41.         <input class="hidden free-codes-count" value="{{ dish.freeCodesCount is defined ? dish.freeCodesCount }}"/>
  42.         <div class="font-size-1125 dish-name font-600">{{ dish.name }}</div>
  43.         <div class="font-size-8125 dish-weight opacity-06 my-2">
  44.             {% if dish.sizeFull %}
  45.                 {{ dish.sizeFull|raw }}
  46.             {% endif %}
  47.         </div>
  48.         <div class="d-flex px-0 info-block-food-item">
  49.             <div class="purchase-count-teaser d-flex ml-1 m-t-3">
  50.                 {% if dish.purchaseCount is defined %}
  51.                 <div class="d-flex justify-content-between align-items-center">
  52.                     <img class="delivery-sales-icon" src="/images/delivery-sales-icon-black.svg" alt="delivery-sales-icon">
  53.                     <p class="delivery-sales">{{ dish.purchaseCount }}</p>
  54.                 </div>
  55.                 {% endif %}
  56.             </div>
  57.             <div class="price-block">
  58.                 <span class="font-size-0875 delivery-price">
  59.                    {% if hasSosediPurchaseForUser is defined and (hasSosediPurchaseForUser == false and dish.id == sosediCertificateTwentyRublesId or hasSosediPurchaseForUser == false and dish.id == sosediCertificateHundredRublesId) %}
  60.                        {{ dish.regularPrice|number_format(2, ',') -  dish.regularPrice|number_format(2, ',')/100*10 }}&nbsp;р
  61.                    {% else %}
  62.                        {{ dish.offerPrice|number_format(2, ',') }} р
  63.                    {% endif %}
  64.                 </span>
  65.                 {% if dish.offerPrice < dish.regularPrice %}
  66.                     <del><span class="delivery-old-price">{{ dish.regularPrice|number_format(2,',') }}&nbsp;р</span></del>
  67.                 {% endif %}
  68.             </div>
  69.         </div>
  70.         {% if dish.pricePerKilogram is defined and dish.pricePerKilogram != null %}
  71.             <div class="js-price-per-kilogram sf-font opacity-06 d-flex justify-flex-end pt-2 d-none">
  72.                 <img alt="" src="/images/weight.svg"/>
  73.                 <p class="mb-0 ml-2 align-self-center"><span id="pricePerKilogramP">{{ dish.pricePerKilogram|number_format(2, ',') }}</span>&nbsp;р&nbsp;/&nbsp;кг</p>
  74.             </div>
  75.         {% endif %}
  76.         {% if dish.freeCodesCount is defined and not dish.freeCodesCount %}
  77.             <div class="sf-text-font font-size-1125 font-800 text-uppercase py-4" style="line-height: 37px;">Продано</div>
  78.         {% else %}
  79.             {% if isAvailableOnFood is not defined or not isAvailableOnFood %}
  80.             <div class="mt-3">
  81.                 {% include 'Slivki/delivery/quantity_select.html.twig' with {} %}
  82.             </div>
  83.             {% endif %}
  84.         {% endif %}
  85.     </div>
  86.     <div class="dish-description hidden">{{ (dish.description ~ getDishNutrients(dish))|raw }}</div>
  87. </div>