templates/modules/app/shopping/includes/products/thumbnail.html.twig line 1

Open in your IDE?
  1. {#
  2.        Affichage de la miniature d'un produit
  3. #}
  4. <div class="product-thumbnail" data-product="{{ product.id }}">
  5.     {% if product_manager.priceTtc != 0 %}
  6.         {% if product_manager.isReduction == 1 %}
  7.             <span class="reduction">promo</span>
  8.         {% endif %}
  9.     {% endif %}
  10.     <a href="{{ product.slug }}" class="product-front product-link">
  11.         <div class="figure">
  12.             {% if configuration.useFiligrane == 1 %}
  13.                 {% set filters = 'filigrane' %}
  14.             {% else %}
  15.                 {% set filters = 'thumbnail' %}
  16.             {% endif %}
  17.             {% if product.cover != null %}
  18.                 {% set image =  product.cover %}
  19.             {% else %}
  20.                 {% set image = 'no_image.png' %}
  21.             {% endif %}
  22.             <img src="{{ image|imagine_filter(filters, {"thumbnail": {"size": [230, 200], "mode" : "inset" }}) }}"
  23.                  alt="">
  24.         </div> {# /.figure #}
  25.         <div class="product-content">
  26.             <p class="product-title">{{ product.designation|replace({'<p>': '', '</p>' : ''})|raw }}</p>
  27.             {% if product.onlineOnly == 0 or product.onlineOnly == 1 %}
  28.                 {% if product_manager.priceTtc != 0 %}
  29.                     <div class="product-prices">
  30.                         <div class="current-price">{{ product_manager.priceTtc|striptags }} &euro;</div>
  31.                         {% if product_manager.isReduction == 1 %}
  32.                             <div class="previous-price">
  33.                                 <span>{{ product_manager.initialPriceTtc|striptags }} &euro;</span>
  34.                             </div>
  35.                         {% endif %}
  36.                     </div>
  37.                 {% endif %}
  38.             {% endif %}
  39.         </div>
  40.         <div class="product-asides">
  41.             {% if account.user.id != null %}
  42.                 <button class="btn btn-favoris-add {% if product_manager.isFavoris(account.user.favoris) == 1 %}active{% endif %}">
  43.                     <div class="block" data-type="1">
  44.                         <svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="heart"
  45.                              class="svg-inline--fa fa-heart fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg"
  46.                              viewBox="0 0 512 512">
  47.                             <path fill="currentColor"
  48.                                   d="M458.4 64.3C400.6 15.7 311.3 23 256 79.3 200.7 23 111.4 15.6 53.6 64.3-21.6 127.6-10.6 230.8 43 285.5l175.4 178.7c10 10.2 23.4 15.9 37.6 15.9 14.3 0 27.6-5.6 37.6-15.8L469 285.6c53.5-54.7 64.7-157.9-10.6-221.3zm-23.6 187.5L259.4 430.5c-2.4 2.4-4.4 2.4-6.8 0L77.2 251.8c-36.5-37.2-43.9-107.6 7.3-150.7 38.9-32.7 98.9-27.8 136.5 10.5l35 35.7 35-35.7c37.8-38.5 97.8-43.2 136.5-10.6 51.1 43.1 43.5 113.9 7.3 150.8z"></path>
  49.                         </svg>
  50.                     </div>
  51.                     <div class="block" data-type="2">
  52.                         <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="heart"
  53.                              class="svg-inline--fa fa-heart fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg"
  54.                              viewBox="0 0 512 512">
  55.                             <path fill="currentColor"
  56.                                   d="M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"></path>
  57.                         </svg>
  58.                     </div>
  59.                 </button>
  60.             {% endif %}
  61.             {% if product_manager.product.features|length <= 0 %}
  62.                 <button class="btn btn-cart-speed product_cart_speed_open">
  63.                     <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
  64.                          y="0px" viewBox="220.2 -65.5 947.5 923"
  65.                          style="enable-background:new 220.2 -65.5 947.5 923;" xml:space="preserve">
  66.   <path d="M528.2,634.6c-61.6,0-111.5,49.9-111.5,111.4s49.9,111.5,111.4,111.5c61.6,0,111.5-49.9,111.5-111.4
  67.     c0,0,0,0,0-0.1C639.5,684.5,589.7,634.7,528.2,634.6z M565.4,746c0,20.6-16.7,37.3-37.3,37.3s-37.3-16.7-37.3-37.3
  68.     s16.7-37.3,37.3-37.3c0,0,0,0,0,0C548.7,708.8,565.4,725.4,565.4,746z"></path>
  69.                         <path d="M931.9,634.6c-61.6,0-111.4,49.9-111.4,111.5s49.9,111.4,111.4,111.4c61.5,0,111.4-49.9,111.4-111.4
  70.     C1043.3,684.5,993.4,634.7,931.9,634.6z M969.2,746.1c0,20.6-16.7,37.3-37.3,37.3c-20.6,0-37.3-16.7-37.3-37.3
  71.     c0-20.6,16.7-37.3,37.3-37.3C952.5,708.8,969.1,725.5,969.2,746.1z"></path>
  72.                         <path d="M1159.2,82c-7.1-7.7-16.7-12.6-27.1-13.6L450.5,59l-15.7-48C419-34.4,376.5-65,328.4-65.5h-71.2
  73.     c-20.5,0-37.1,16.6-37.1,37.1s16.6,37.1,37.1,37.1h70.8c16.4,0.4,30.9,10.9,36.3,26.3l133,401.2l-8.4,19.5
  74.     c-13.6,35.3-9.5,75.1,11.1,106.8c20.6,31.4,55.3,50.8,92.9,51.8h413.2c20.5,0,37.1-16.6,37.1-37.1s-16.6-37.1-37.1-37.1H593.4
  75.     c-12.9-0.3-24.8-7.1-31.6-18.1c-7-11.2-8.4-24.8-4.3-36.2l4.8-10.7l438.2-45.8c55.7-6.2,101.6-46.7,114.6-101.3l50.8-212.7
  76.     C1169.7,103.8,1167.2,91.1,1159.2,82z M562.6,399.6l-87.8-266.3l609.2,8.9l-41,168.8l-0.1,0.3c-5.4,24.4-26.1,42.3-51,44
  77.     L562.6,399.6z"></path>
  78. </svg>
  79.                     <span class="cart_tag">+</span>
  80.                 </button>
  81.             {% endif %}
  82.         </div>
  83.     </a> {# /.product-link #}
  84.     {% if product_manager.product.features|length <= 0 %}
  85.         <div class="product-back">
  86.             <div class="figure">
  87.                 {% if configuration.useFiligrane == 1 %}
  88.                     {% set filters = 'filigrane' %}
  89.                 {% else %}
  90.                     {% set filters = 'thumbnail' %}
  91.                 {% endif %}
  92.                 {% if product.cover != null %}
  93.                     {% set image =  product.cover %}
  94.                 {% else %}
  95.                     {% set image = 'no_image.png' %}
  96.                 {% endif %}
  97.                 <img src="{{ image|imagine_filter(filters, {"thumbnail": {"size": [230, 200], "mode" : "inset" }}) }}"
  98.                      alt="">
  99.             </div> {# /.figure #}
  100.             <div class="product-content">
  101.                 <label for="product_cart_speed_quantity_{{ product.id }}" class="product-title">{{ product.designation|replace({'<p>': '', '</p>' : ''})|raw }}</label>
  102.                 {% if product_manager.product.onlineOnly == 0 or product_manager.product.onlineOnly == 1 and product_manager.product_manager.priceTtc > 0 and product_manager.product.stock > 0 %}
  103.                     <form>
  104.                         <div class="form-group">
  105.                             <button class="btn-quantity product_cart_speed_remove">-</button>
  106.                             <input type="text" value="1" class="product_cart_speed_quantity" id="product_cart_speed_quantity_{{ product.id }}">
  107.                             <button class="btn-quantity product_cart_speed_add">+</button>
  108.                         </div>
  109.                         <div class="form-group form-controls">
  110.                             <button class="btn btn-submit product_cart_speed_submit">Ajouter au panier</button>
  111.                             <button class="btn-cancel product_cart_speed_cancel">Annuler</button>
  112.                             <p class="product_cart_speed_messages"></p>
  113.                         </div>
  114.                     </form>
  115.                 {% else %}
  116.                     <p class="status">Indisponnible</p>
  117.                 {% endif %}
  118.             </div>
  119.             <div class="product-asides">
  120.                 <button class="btn-cancel product_cart_speed_cancel">
  121.                     <i class="fas fa-arrow-right"></i>
  122.                 </button>
  123.             </div>
  124.         </div>
  125.     {% endif %}
  126. </div> {# /.product-thumbnail #}