templates/frontView/product/partials/_product_card.html.twig line 1

Open in your IDE?
  1. <div class="col-xxl-2 col-xl-3 col-lg-4 col-md-4 col-sm-6 col-12 product-card-column">
  2.     <div class="card product-card h-100">
  3.         <!-- Product Image -->    
  4.         <div class="product-image">
  5.             <div class="image-content">
  6.                 <div class="image-wrapper">
  7.                     <img src="{{ asset('img/logo-rapeto-img.png') }}" class="logo">
  8.                     <a href="{{ path('app_product_show', {'id': product.id}) }}">
  9.                         <img
  10.                             src="{{ asset('uploads/products/' ~ product.picture) }}"
  11.                             class="product-thumb"
  12.                             alt="{{ product.title }}"
  13.                         >
  14.                     </a>
  15.                 </div>
  16.             </div>
  17.         </div>
  18.         <!-- Card Body -->
  19.         <div class="card-body d-flex flex-column">
  20.             <!-- Title -->
  21.             <h6 class="product-title">
  22.                 <a href="{{ path('app_product_show', {'id': product.id}) }}"
  23.                 class="product-link"
  24.                 data-click-url="{{ path('app_product_click', {'id': product.id}) }}">
  25.                     {{ product.title }}
  26.                 </a>
  27.             </h6>
  28.             
  29.             <span class="product-type product-type-sale">{{ product.statetypeLabels|join(' / ') }}</span>
  30.             <!-- Description -->
  31.             <p class="product-desc">
  32.                 {{ product.desctription|slice(0,60) }}...
  33.             </p>
  34.             <!-- Price -->
  35.             {# <div class="price-section mt-auto">
  36.                 {% if is_granted('ROLE_COM') %}
  37.                     <span class="price">
  38.                         {{ product.priceProducts[0].priceDealer|number_format(2, '.', ' ') }} 
  39.                     </span>
  40.                 {% elseif is_granted('ROLE_CUSTOMER') %}
  41.                     <span class="price">
  42.                         {{ product.priceProducts[0].priceBulkCustomer|number_format(2, '.', ' ') }} 
  43.                     </span>
  44.                 {% else %}
  45.                     <span class="price">
  46.                         {{ product.priceProducts[0].priceCustomer|number_format(2, '.', ' ') }} 
  47.                     </span>
  48.                 {% endif %}
  49.                 <sup>{{ product.fkdevise.title }}</sup>
  50.             </div> #}
  51.             {% set price = product.priceProducts|first %}
  52.             <div class="price-section mt-auto d-none">
  53.                 {% if price %}
  54.                     {% if is_granted('ROLE_COM') %}
  55.                         {% set normalPrice = price.priceCustomer %}
  56.                         {% set promoPrice  = price.promoPriceCustomer %}
  57.                     {% elseif is_granted('ROLE_CUSTOMER') %}
  58.                         {# {% set normalPrice = price.priceBulkCustomer %}
  59.                         {% set promoPrice  = price.promoPriceBulkCustomer %} #}
  60.                         {% set normalPrice = price.priceCustomer %}
  61.                         {% set promoPrice  = price.promoPriceCustomer %}
  62.                     {% else %}
  63.                         {% set normalPrice = price.priceCustomer %}
  64.                         {% set promoPrice  = price.promoPriceCustomer %}
  65.                     {% endif %}
  66.                     {% if price.isPromotionValid and promoPrice %}
  67.                         <span class="old-price">
  68.                             {{ normalPrice|number_format(2, '.', ' ') }}
  69.                         </span>
  70.                         <br>
  71.                         <span class="price text-danger fw-bold">
  72.                             {{ promoPrice|number_format(2, '.', ' ') }}
  73.                         </span>
  74.                     {% else %}
  75.                         <span class="price">
  76.                             {{ normalPrice|number_format(2, '.', ' ') }}
  77.                         </span>
  78.                     {% endif %}
  79.                     <sup>{{ product.fkdevise.title }}</sup>
  80.                 {% endif %}
  81.             </div>
  82.             <!-- Category -->
  83.             <small class="text-muted mt-1">
  84.                 {{ product.fkcategorie.title }}
  85.             </small>
  86.             <!-- Action -->
  87.             <div class="d-flex justify-content-between align-items-center mt-3">
  88.                 <a href="{{ path('app_product_show', {'id': product.id}) }}"
  89.                 class="btn btn-outline-primary btn-sm product-link"
  90.                 data-click-url="{{ path('app_product_click', {'id': product.id}) }}">
  91.                     Voir
  92.                 </a>
  93.                 <a href="{{ path('app_product_panier', {'product': product.id}) }}"
  94.                 class="btn btn-warning btn-sm d-none"
  95.                 title="Ajouter au panier"
  96.                 aria-label="Ajouter {{ product.title }} au panier">
  97.                     <i class="bi bi-cart-plus-fill"></i>
  98.                 </a>
  99.             </div>
  100.             {% if temoin is defined and product.id == temoin %}
  101.                 <small class="text-danger mt-2">{{ message }} </small>
  102.             {% endif %}
  103.         </div>
  104.     </div>
  105. </div>