templates/products/similars.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Produits - Similaires{% endblock %}
  3. {% block body %}
  4.     {% block block_navstart %} {% include "_partials/_nav.html.twig" %} {% endblock %}
  5.     <div class="row justify-content-center">
  6.         <div class="col-lg-6 col-md-8">
  7.         {{ form_start(form, {'attr': {'class': 'form-inline ml-3'}}) }} 
  8.                 <div class="input-group">
  9.                     <a class="mt-4 mx-2" href="{{ path('app_products_similars',{catego: catSimilar}) }}">
  10.                     <i class="fa-solid fa-rotate-right fa-2x bg-light"></i></a>
  11.                     {{ form_row(form.q, {'attr': {'class': 'form-control W-500 border-3'}}) }}
  12.                     <div class="input-group-append">
  13.                         <button type="submit" class="btn btn-light mt-4 border-3">
  14.                             <i class="fas fa-search text-muted"></i>
  15.                         </button>
  16.                     </div>
  17.                 </div>
  18.         {{ form_end(form) }} <!--    -->
  19.         </div>
  20.     </div>
  21.     <!-- ARTICLES --> {# équivalent #}    
  22.     <section class="products">
  23.         <div class="container">
  24.             <div class="row">
  25.                 <div class="col-12">
  26.                     <h2 class="bg-light " style="color:#808000;">BestMarketBusiness - Liste Produits Similaires</h2>
  27.                     <p><strong>Pour faciliter la recherche des Articles ou Produits similaires, Saisissez le nom de la VILLE ou le 
  28.                         PAYS ou la LOCALITE dans la barre de recherche....</strong>
  29.                     </p>
  30.                 </div>  
  31.             </div>
  32.             <div class="row">
  33.                 {% for product in productsSimilars %}
  34.                     {% if product.categories.id == catSimilar %}
  35.                         <div class="col-md-6 col-lg-3 my-1">
  36.                             <article class="card p-2">
  37.                                 <h1 class="h5"><strong>{{ product.name }}</strong></h1>
  38.                                 <img src="{{ asset('uploads/images/' ~ product.imageFileName) }}" 
  39.                                     alt="{{ product.name }}" class="img-fluid" style="width: 300px; height: 300px;" />
  40.                                 <div>{{ product.description | slice (0, 50) }}...etc.</div>
  41.                                 <div style="color:green;"><strong>{{ product.price }}</strong></div>
  42.                                 <div><strong>{{ product.categories.name }}</strong></div>
  43.                                 <div style="color:#808000;"><strong>{{ product.city }} - ({{ product.country }})</strong></div>
  44.                                 <div>
  45.                                     <a href="{{ path('app_products_details', {slug: product.slug, id: product.id}) }}" class="btn btn-primary btn-sm">Voir les détails</a>
  46.                                     <a href="{{ path('app_products_similars', {catego: product.categories.id}) }}" class="btn btn-secondary btn-sm">Produits similaires</a> 
  47.                                     
  48.                                     {% set i = 0 %}
  49.                                     {% for statElem in allStatistiques %}
  50.                                         {% if product.id == statElem.idElement and statElem.page == 'DETAIL_PRODUCT' %}
  51.                                             {% set i = i + 1 %}
  52.                                         {% endif %}
  53.                                     {% endfor %}  
  54.                                     {% include '_partials/_compteur_vues.html.twig' %}      {## COMPTEUR_VUES ##}
  55.                                 </div>
  56.                             </article>
  57.                         </div>
  58.                     {% endif %}
  59.                 {% endfor %}
  60.             </div>
  61.         </div>
  62.     </section>
  63. {% endblock %}