themes/BootstrapTheme/templates/bundles/MonsieurBizSyliusSearchPlugin/Taxon/result.html.twig line 1

Open in your IDE?
  1. {% extends '@SyliusShop/layout.html.twig' %}
  2. {% import '@SyliusUi/Macro/pagination.html.twig' as pagination %}
  3. {% block title %}{% if taxon is defined and taxon.translation.metaTitle is not null %}{{ taxon.translation.metaTitle }}{% else %}{{ parent() }}{% endif %}{% endblock %}
  4. {% block metatags %}
  5.     {% if taxon is defined and taxon.translation.metaDescription is not null %}
  6.         <meta name="description" content="{{ taxon.translation.metaDescription }}">
  7.     {% else %}
  8.         {{ parent() }}
  9.     {% endif %}
  10. {% endblock %}
  11. {% block content %}
  12.     <div class="page-categorie-content">
  13.         <div class="categorie-top position-relative zindex-1">
  14.             <div class="object-img-categ">
  15.                 {% if taxon.images|length > 1 %}
  16.                     {% set path = taxon.images[1].path|imagine_filter(filter|default('app_taxon_image_large_thumbnail')) %}
  17.                 {% else %}
  18.                     {% set path = asset('images/img_categ.jpg') %}
  19.                 {% endif %}
  20.                 <img src="{{ path }}" alt="{{ taxon.name }}" class="" />
  21.             </div>
  22.             <div class="categorie-img max-container-5 px-0">
  23.                 <div class="px-md-0 px-2  position-relative zindex-3">
  24.                     {{ render(url('sylius_shop_partial_taxon_show_by_slug', {'slug': app.request.attributes.get('slug'),'template': '@SyliusShop/Taxon/_breadcrumb.html.twig'})) }}
  25.                 </div>
  26.                 <div class="absolute-categ text-center">
  27.                     <h1 class="title-categ">{{ taxon.name }}</h1>
  28.                     <div class="fontsize-normal text-grey max-line-3 pt-2">{{ taxon.translation.description|raw }}</div>
  29.                 </div>
  30.             </div>
  31.         </div>
  32.         <div class="max-container-5 px-0">
  33.             <div class="categorie-bottom">
  34.                 {% if result.count == 0 %}
  35.                     <div class="no-result pt-md-4 pt-2 pb-md-4 pb-2 mt-xl-2 px-lg-0 px-3">
  36.                         <div class="py-4 my-3 text-center ">
  37.                             <div class="d-inline-block">
  38.                                 <div class="alert alert-danger">
  39.                                     {{ 'app.common.aucun_produit_disponible'|trans }}
  40.                                 </div>
  41.                             </div>
  42.                         </div>
  43.                     </div>
  44.                 {% else %}
  45.                     <div class=" mt-perso-vh">
  46.                         <div class="filtre-cat bg-gradient-orange">
  47.                             <div class="categorie-filtre mbiz-sylius-search-filters">
  48.                                 <div class="lib-f-c fontsize-mobile-text">
  49.                                     <span class="d-block">{{'app.taxon.filter_by'|trans}} </span>
  50.                                 </div>
  51.                                 <div class="d-md-none d-block mobile-label-filtre bg-gradient-orange bg-gradient-hover text-uppercase">{{'sylius.ui.filters'|trans}} <i class="icon-up-open-big"></i></div>
  52.                                 <div class="cell-facette">
  53.                                     <span class="close-filtre-categ d-block d-md-none bg-gradient-orange"><img src="{{ asset('images/closemenu.png')}}" alt="X" class="d-block" /></span>
  54.                                     <div class="content-fitre-categ align-items-center justify-content-center">
  55.                                         {% include '@MonsieurBizSyliusSearchPlugin/Search/_sidebar.html.twig' %}
  56.                                     </div>
  57.                                 </div>
  58.                             </div>
  59.                         </div>
  60.                     </div>
  61.                     <div class="res-filtre  fontsize-mobile-text pb-md-0 pb-2 d-none d-md-block pt-md-3 px-lg-0 px-3">
  62.                     </div>
  63.                     <div class="liste-articles pt-md-4 pt-2 pb-md-4 pb-2 mt-xl-2 px-lg-0 px-3">
  64.                         <div class="row mx-n2 mx-n3 mx-lg-n3p mx-xs-n2" id="products">
  65.                             {% set productsUsefullNbr = taxon.productsUsefull.count %}
  66.                             {% set productsNbr = result.count %}
  67.                             {% if productsUsefullNbr == 1 %}
  68.                                 {% set productUsefullPos = (productsNbr /  2)|round %}
  69.                             {% elseif productsUsefullNbr > 0 %}
  70.                                 {% set productUsefullPos = (productsNbr /  productsUsefullNbr)|round %}
  71.                             {% endif %}
  72.                             {% set i = 0 %}
  73.                             {% set itemNum = 0 %}
  74.                             {% for item in result %}
  75.                                 {% set itemNum = itemNum + 1 %}
  76.                                 <div class="col-lg-3 col-md-4 col-sm-6 col-12 px-3 mb-md-3 mb-4 px-lg-3p mb-lg-5p px-xs-2">
  77.                                     {% set product = product_repository.find(item.id) %}
  78.                                     {% include '@SyliusShop/Product/_box.html.twig' with {'product': product} only %}
  79.                                 </div>
  80.                                 {% if productsUsefullNbr > 0 and i < productsUsefullNbr %}
  81.                                     {% if itemNum == productUsefullPos %}
  82.                                         {% for itemUsefull in taxon.productsUsefull|slice(i, i + 1) %}
  83.                                             {% set productUsefull = product_repository.find(itemUsefull.id) %}
  84.                                             {% if productUsefull.enabled %}
  85.                                                 <div class="col-lg-3 col-md-4 col-sm-6 col-12 px-3 mb-md-3 mb-4 px-lg-3p mb-lg-5p px-xs-2 article-usefull">
  86.                                                     {% include '@SyliusShop/Product/_box.html.twig' with {'product': productUsefull} only %}
  87.                                                 </div>
  88.                                             {% endif %}
  89.                                             {% set i = i + 1 %}
  90.                                         {% endfor %}
  91.                                         {% set itemNum = 0 %}
  92.                                     {% endif %}
  93.                                 {% endif %}
  94.                             {% endfor %}
  95.                             {% if productsUsefullNbr > 0 and i < productsUsefullNbr %}
  96.                                 {% for itemUsefull in taxon.productsUsefull|slice(i, i + 1) %}
  97.                                     {% set productUsefull = product_repository.find(itemUsefull.id) %}
  98.                                     {% if productUsefull.enabled %}
  99.                                         <div class="col-lg-3 col-md-4 col-sm-6 col-12 px-3 mb-md-3 mb-4 px-lg-3p mb-lg-5p px-xs-2 article-usefull">
  100.                                             {% include '@SyliusShop/Product/_box.html.twig' with {'product': productUsefull} only %}
  101.                                         </div>
  102.                                     {% endif %}
  103.                                     {% set i = i + 1 %}
  104.                                 {% endfor %}
  105.                             {% endif %}
  106.                         </div>
  107.                         {{ pagination.simple(result.paginator) }}
  108.                     </div>
  109.                 {% endif %}
  110.             </div>
  111.             <div class="text-center max-container-5 px-0">
  112.                 <div class="fontsize-normal text-grey max-line-3 pt-2">{{ taxon.translation.textSEO|raw }}</div>
  113.             </div>
  114.         </div>
  115.     </div>
  116. {% endblock %}