templates/App/checkout/partials/product_upsells_page.html.twig line 1

Open in your IDE?
  1. {% import 'App/checkout/currency_macros.html.twig' as currencyPosition  %}
  2. {% if product.upsells %}
  3.     {% for upsell in product.upsells%}
  4.         {% if not upsell.productDetail.outOfStock %}
  5.             {% set choosedUpsellQuantity = choosedUpsells[upsell.id] is defined ? choosedUpsells[upsell.id]['quantity'] : 0 %}
  6.             <div class="upsell-list">
  7.                 <div class="upsell-product">
  8.                     <div class="row">
  9.                         <div class="col-5 pr-3 pt-0">
  10.                             {% if upsell.imagePath %}
  11.                                 {% if discountPercentage is defined and discountPercentage > 0%}
  12.                                     <div class="product-offer-badge">{{ discountPercentage }}% {{ 'extraDiscount'| trans }}</div>
  13.                                 {% endif %}
  14.                                 <img class="w-100" src="{{ asset('assets/uploads/'~upsell.imagePath) }}" alt="{{ upsell.title }}" >
  15.                             {% endif %}
  16.                         </div>
  17.                         <div class="col-7 pt-0 product-info">
  18.                             <h3 class="product-title">{{ upsell.title }}</h3>
  19.                             <div class="product-pricing">
  20.                                 {% if upsell.productDetail.recommendRetailPrice != upsell.variants | first.totalPrice %}
  21.                                     <span class="original-price">
  22.                                             {{ currencyPosition.smallNumbers(convertEURToAnotherCurrency(currency, upsell.productDetail.recommendRetailPrice), currency|currency_symbol, 'small-upsell-unit' ) }}
  23.                                         </span>
  24.                                 {% endif %}
  25.                                 <span class="discounted-price dl-price dl-upsell-price">
  26.                                         <dd>
  27.                                         {{ currencyPosition.smallNumbers(upsell.variants | first.totalPrice, currency|currency_symbol ) }}
  28.                                         </dd>
  29.                                     </span>
  30.                             </div>
  31.                             <div class="upsell-product__description text-left">
  32.                                 {{ upsell.description | raw }}
  33.                             </div>
  34.                             <div class="upsell-product__manage mt-2 d-flex justify-content-between align-items-center">
  35.                                 <div class="upsell-counter-container">
  36.                                     <span role="button" class="btn add-to-card-btn add-upsell-to-card-btn change-quantity {% if choosedUpsellQuantity %}d-none{% endif %}" data-operation="+">{{ 'addToCard'| trans }}</span>
  37.                                     <div class="input-group upsell-counter {% if not choosedUpsellQuantity %}d-none{% endif %}">
  38.                                         <div class="input-group-append decrement-btn">
  39.                                             <span role="button" class="input-group-text change-quantity" data-operation="-">-</span>
  40.                                         </div>
  41.                                         <span class="form-control text-center upsell-quantity" data-product-id="{{ upsell.id }}" data-value="{{ choosedUpsellQuantity }}" data-max-qty="{{ upsell.maxQuantity }}">{{ choosedUpsellQuantity }}</span>
  42.                                         <div class="input-group-append increment-btn">
  43.                                             <span role="button" class="input-group-text change-quantity {% if upsell.maxQuantity and upsell.maxQuantity <= choosedUpsellQuantity %} invisible {% endif %}" data-operation="+">+</span>
  44.                                         </div>
  45.                                     </div>
  46.                                 </div>
  47.                             </div>
  48.                         </div>
  49.                     </div>
  50.                 </div>
  51.             </div>
  52.         {% endif %}
  53.     {% endfor %}
  54.     <hr>
  55. {% endif %}