{% extends 'base.html.twig' %}
{% block title %}Produits - Similaires{% endblock %}
{% block body %}
{% block block_navstart %} {% include "_partials/_nav.html.twig" %} {% endblock %}
<div class="row justify-content-center">
<div class="col-lg-6 col-md-8">
{{ form_start(form, {'attr': {'class': 'form-inline ml-3'}}) }}
<div class="input-group">
<a class="mt-4 mx-2" href="{{ path('app_products_similars',{catego: catSimilar}) }}">
<i class="fa-solid fa-rotate-right fa-2x bg-light"></i></a>
{{ form_row(form.q, {'attr': {'class': 'form-control W-500 border-3'}}) }}
<div class="input-group-append">
<button type="submit" class="btn btn-light mt-4 border-3">
<i class="fas fa-search text-muted"></i>
</button>
</div>
</div>
{{ form_end(form) }} <!-- -->
</div>
</div>
<!-- ARTICLES --> {# équivalent #}
<section class="products">
<div class="container">
<div class="row">
<div class="col-12">
<h2 class="bg-light " style="color:#808000;">BestMarketBusiness - Liste Produits Similaires</h2>
<p><strong>Pour faciliter la recherche des Articles ou Produits similaires, Saisissez le nom de la VILLE ou le
PAYS ou la LOCALITE dans la barre de recherche....</strong>
</p>
</div>
</div>
<div class="row">
{% for product in productsSimilars %}
{% if product.categories.id == catSimilar %}
<div class="col-md-6 col-lg-3 my-1">
<article class="card p-2">
<h1 class="h5"><strong>{{ product.name }}</strong></h1>
<img src="{{ asset('uploads/images/' ~ product.imageFileName) }}"
alt="{{ product.name }}" class="img-fluid" style="width: 300px; height: 300px;" />
<div>{{ product.description | slice (0, 50) }}...etc.</div>
<div style="color:green;"><strong>{{ product.price }}</strong></div>
<div><strong>{{ product.categories.name }}</strong></div>
<div style="color:#808000;"><strong>{{ product.city }} - ({{ product.country }})</strong></div>
<div>
<a href="{{ path('app_products_details', {slug: product.slug, id: product.id}) }}" class="btn btn-primary btn-sm">Voir les détails</a>
<a href="{{ path('app_products_similars', {catego: product.categories.id}) }}" class="btn btn-secondary btn-sm">Produits similaires</a>
{% set i = 0 %}
{% for statElem in allStatistiques %}
{% if product.id == statElem.idElement and statElem.page == 'DETAIL_PRODUCT' %}
{% set i = i + 1 %}
{% endif %}
{% endfor %}
{% include '_partials/_compteur_vues.html.twig' %} {## COMPTEUR_VUES ##}
</div>
</article>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</section>
{% endblock %}