{% extends 'base.html.twig' %}{% block title %}{{ title }}{% endblock %}{% block meta %} <meta name="description" content="{{ 'accessories.meta_description'|trans }}"> <meta name="keywords" content="{{ 'accessories.meta_keywords'|trans }}"> <meta property="og:url" content="path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params'))" />{% endblock %}{% block hero %} <h1 class="text-center">{{ title }}</h1> <p class="text-center color-primary">{{ 'accessories.poster_note'|trans }}</p>{% endblock %}{% block body %} <section class="accessories_list"> <div class=""> <div class="filter__item"> <div class="row"> <div class="col-lg-2 col-md-3 col-sm-3 col-6"> <div> <select class="filter__sort form-select"> <option value="{{ path('dj_accessories') }}">{{ 'accessories.sort_by'|trans }}</option> <option {% if sort == "price-asc" %}selected="selected"{% endif %} value="{{ path(app.request.attributes.get('_route'), app.request.query.all) }}{% if app.request.query.all %}&{% else %}?{% endif %}page={{ page }}&sort=price&direction=asc">{{ 'accessories.price_asc'|trans }}</option> <option {% if sort == "price-desc" %}selected="selected"{% endif %} value="{{ path(app.request.attributes.get('_route'), app.request.query.all) }}{% if app.request.query.all %}&{% else %}?{% endif %}page={{ page }}&sort=price&direction=desc">{{ 'accessories.price_desc'|trans }}</option> </select> </div> </div> <div class="col-lg-10 col-md-6 col-sm-6 col-6 d-flex align-items-center"> <div class="filter__found text-start"> <h4> <span>{{ accessories.getTotalItemCount }}</span> accessories </h4> </div> </div> </div> </div> <div class="row"> {% for accessory in accessories %} <div class="col-lg-3 col-md-6 col-sm-6 mt-4"> <div class="product__item d-flex flex-column h-100 bg-white rounded p-2 {% if accessory.quantity > 0 %}box-green{% else %}box-red{% endif %}"> <div class="product__item__pic text-center"> {% if accessory.img != null %} <a href="{{ path('dj_accessory', {'slug': accessory.slug}) }}"> <img src="{{ asset('uploads/accessories/' ~ accessory.slug ~ '/' ~ accessory.img) }}" class="card-img-top" alt="{{ accessory.designation }}"> </a> {% else %} <a href="{{ path('dj_accessory', {'slug': accessory.slug}) }}"> <img src="{{ asset('uploads/accessories/default_accessory.png') }}" class="card-img-top" alt="{{ accessory.designation }}"> </a> {% endif %} <ul class="product__item__pic__hover"> {# <li> <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://www.mazykkaaccessories Dj/vinyle/{{ accessory.slug }}/&src=sdkpreparse" class="fb-xfbml-parse-ignore"> <i class="fa fa-facebook"></i> </a> </li> #} {# <li> <a href="{{ path('cart_add', {'id': accessory.id}) }}"> <i class="fa fa-shopping-cart"></i> </a> </li> #} </ul> </div> <div class="product__item__text"> <h6> <a href="{{ path('dj_accessory', {'slug': accessory.slug}) }}">{{ accessory.designation }}</a> </h6> {% if accessory.promo and accessory.promo > 0 %} <h5> <del class="fw-normal fs-6 me-2">{{ accessory.price|number_format(2) }} € <span class="vat">TTC</span></del> <span class="success">{{ accessory.promo|number_format(2) }} €</span></h5> {% else %} <h5>{{ accessory.price|number_format(2) }} € <span class="vat">TTC</span></h5> {% endif %} </div> <div class="mt-auto text-center"> {% if accessory.quantity > 0 %} {% if app.user %} <a href="{{ path('cart_add', {'id': accessory.id}) }}" class="btn btn-primary mt-2 w-100"> <i class="fa fa-shopping-cart" aria-hidden="true"></i> </a> {% else %} <button type="button" class="btn btn-primary mt-2 w-100" data-bs-toggle="modal" data-bs-target="#needConnexionModal"> <i class="fa fa-shopping-cart" aria-hidden="true"></i> </button> {% endif %} {% else %} <h3 class="red">Hors stock</h3> {% endif %} </div> </div> </div> {% endfor %} </div> <div class="pagination my-3 d-flex justify-content-center"> {{ knp_pagination_render(accessories, '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig') }} </div> </div> </section>{% endblock %}{% block javascript %}{% endblock %}