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

Open in your IDE?
  1. {% extends '@SyliusShop/layout.html.twig' %}
  2. {% import '@SyliusUi/Macro/pagination.html.twig' as pagination %}
  3. {% block title %}
  4.     {% if taxon is defined and taxon.translation.metaTitle is not null %}
  5.         {{ taxon.translation.metaTitle }}
  6.     {% else %}
  7.         {% if app_get_page_meta_by_code("taxon",{ 'taxon': taxon }) is not empty %}
  8.             {% set meta = app_get_page_meta_by_code("taxon", { 'taxon': taxon }) %}
  9.             {% if meta.title is not null %}
  10.                 {{ meta.title }}
  11.             {% else %}
  12.                 {{ parent() }}
  13.             {% endif %}
  14.         {% else %}
  15.             {{ parent() }}
  16.         {% endif %}
  17.     {% endif %}
  18. {% endblock %}
  19. {% block metatags %}
  20.     {% if taxon is defined and taxon.translation.metaDescription is not null %}
  21.         <meta name="description" content="{{ taxon.translation.metaDescription }}">
  22.     {% else %}
  23.         {% if app_get_page_meta_by_code("taxon", { 'taxon': taxon}) is not empty %}
  24.             {% set meta = app_get_page_meta_by_code("taxon", { 'taxon': taxon }) %}
  25.             {% if meta.metaDescription is not null %}
  26.                 <meta name="description" content="{{ meta.metaDescription }}">
  27.             {% else %}
  28.                 {{ parent() }}
  29.             {% endif %}
  30.         {% else %}
  31.             {{ parent() }}
  32.         {% endif %}
  33.     {% endif %}
  34.     {% if taxon.translation.metaRobotIndex == true %}
  35.         {% set metaRobotIndex = 'index, follow' %}
  36.     {% elseif taxon.translation.metaRobotIndex == false %}
  37.         {% set metaRobotIndex = 'noindex, nofollow' %}
  38.     {% endif %}
  39.     {% if metaRobotIndex is defined %}
  40.         <meta name="robots" content="{{ metaRobotIndex }}"/>
  41.     {% endif %}
  42. {% endblock %}
  43. {% block content %}
  44.     {% set wishlist = null %}
  45.     {% if app.user %}
  46.         {% set wishlist = app_get_wishlist() %}
  47.     {% endif %}
  48.     <section class="container px-xl-0 px-2">
  49.         <section class="container-page-aside pb-2">
  50.             <div class="">
  51.                 {{ render(url('sylius_shop_partial_taxon_show_by_slug', {'slug': app.request.attributes.get('slug'),'template': '@SyliusShop/Taxon/_breadcrumb.html.twig'})) }}
  52.             </div>
  53.             <div class="bg-white rounded-10 border p-xl-4 p-3 mb-4 page-categorie-content">
  54.                 <div class="categorie-top pb-2 gradient-whiteb avenir-book pr-xl-5 pr-4">
  55.                     <h1 class="title-big text-left has-after pb-3">{{ taxon.name }}</h1>
  56.                     <div class="expand-me font-15 font-16-mobile">
  57.                         {{ taxon.translation.description|raw }}
  58.                     </div>
  59.                 </div>
  60.                 {% if taxon.children|length > 0 %}
  61.                 
  62.                 <div class="pt-3 sscategorie-container font-16-mobile  {% if taxon.children|length < 20 %} max-container-txt {% endif %}">
  63.                     <ul class="row no-gutters pl-3 ">
  64.                         {% for childTaxon in taxon.children %}
  65.                         <li class="col-12 pr-md-3  {% if taxon.children|length < 20 %}col-md-6 {% else %} col-lg-4 col-md-6 {% endif %}"><a href="{{ path('monsieurbiz_sylius_search_taxon', {'slug': childTaxon.slug, '_locale': childTaxon.translation.locale}) }}" title="{{ childTaxon.name }}">{{ childTaxon.name }}</a></li>
  66.                         {% endfor %}
  67.                     </ul>
  68.                 </div>
  69.                 {% endif %}
  70.                     {% if result.count == 0 %}
  71.                     <div class="categorie-bottom px-lg-0">
  72.                         <div class="no-result pt-md-4 pt-2 pb-md-4 pb-2 mt-xl-2 px-lg-0 px-3">
  73.                             <div class="py-4 my-3 text-left ">
  74.                                 <div class="d-inline-block">
  75.                                     <div class="alert alert-danger">
  76.                                         {{ 'app.common.no_product_available'|trans }}
  77.                                     </div>
  78.                                 </div>
  79.                             </div>
  80.                         </div>
  81.                     </div>
  82.                     {% else %}
  83.                     <div class="pb-3">
  84.                         <div class="filtre-cat mt-3">
  85.                             <div class="categorie-filtre mbiz-sylius-search-filters row no-gutters align-items-center">
  86.                                 <div class="lib-f-c font-weight-bold font-16  pr-xl-5 pr-3 col-auto">
  87.                                     <span class="d-block pb-2">Trier par :</span>
  88.                                 </div>
  89.                                 <div class="d-lg-none d-block py-3 text-center ">
  90.                                     <div class="d-inline-block mobile-label-filtre">
  91.                                         <span class="d-flex align-items-center">
  92.                                             <svg class="burger-icon" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  93.                                                 <g id="burger" stroke="none" stroke-width="0" fill="#fff" fill-rule="evenodd">
  94.                                                     <g id="group-desktop" fill-rule="nonzero">
  95.                                                         <path d="M5,7.625 L25,7.625" stroke-width="1.875" stroke-linecap="round" stroke-linejoin="round"></path>
  96.                                                         <path d="M5,15.125 L25,15.125" stroke-width="1.875" stroke-linecap="round" stroke-linejoin="round"></path>
  97.                                                         <path d="M5,22.625 L25,22.625" stroke-width="1.875" stroke-linecap="round" stroke-linejoin="round"></path>
  98.                                                     </g>
  99.                                                 </g>
  100.                                             </svg>
  101.                                             <strong class="">{{'app.taxon.sort_by'|trans}}</strong>
  102.                                         </span>
  103.                                     </div>
  104.                                 </div>
  105.                                 <div class="cell-facette col">
  106.                                     <div class="d-flex justify-content-between d-lg-none align-items-center p-3 border-bottom">
  107.                                         <strong class="font-20 text-uppercase">{{'app.taxon.refine_your_choice'|trans}}</strong>
  108.                                         <span class="close-filtre-categ "><img src="{{asset('images/closemenu.png')}}" alt="X" class="d-block" /></span>
  109.                                     </div>
  110.                                     <div class="content-fitre-categ align-items-center justify-content-center">
  111.                                         {% include '@MonsieurBizSyliusSearchPlugin/Search/_sidebar.html.twig' %}
  112.                                     </div>
  113.                                 </div>
  114.                             </div>
  115.                         </div>
  116.                         <div class="res-filtre  fontsize-mobile-text pb-md-0 pb-2 ">
  117.                             <div class="row no-gutters align-items-center justify-content-between">
  118.                                 <div class="col ">
  119.                                     <span class="d-inline-block font-16">{{'app.taxon.your_selection'|trans}} :</span>
  120.                                     <div class="d-inline-block">
  121.                                         {% for filter in result.filters %}
  122.                                             {% for value in filter.values %}
  123.                                                 {% if value.isApplied and filter.type != "range" %}
  124.                                                     <span class="filtre delete-filter" data-filter="{{ 'filter-' ~ filter.code ~ '-value-' ~ value.slug }}" ><i class="icon-cancel"></i><span>{{ value.label}} </span></span>
  125.                                                 {% endif %}
  126.                                             {% endfor %}
  127.                                         {% endfor %}
  128.                                     </div>
  129.                                 </div>
  130.                                 <div class="col-auto">
  131.                                     {{result.count}} {{'app.taxon.items'|trans}}
  132.                                 </div>
  133.                             </div>
  134.                         </div>
  135.                     </div>
  136.                     <div class="categorie-bottom px-lg-0">
  137.                         <div class="py-4">
  138.                             <div class="row justify-content-between no-gutters px-xl-0 px-lg-2 px-0">
  139.                                 <div class="col-auto  pr-1">{% include '@MonsieurBizSyliusSearchPlugin/Search/_pagination.html.twig' %}</div>
  140.                                 <div class="col-auto  pl-1">{% include '@MonsieurBizSyliusSearchPlugin/Search/_sorting.html.twig' %}</div>
  141.                             </div>
  142.                         </div>
  143.                         <div class="row no-gutters mx-n3" id="products">
  144.                             {% set productsUsefullNbr = taxon.productsUsefull.count %}
  145.                             {% set productsNbr = result.count %}
  146.                             {% if productsUsefullNbr == 1 %}
  147.                                 {% set productUsefullPos = (productsNbr /  2)|round %}
  148.                             {% elseif productsUsefullNbr > 0 %}
  149.                                 {% set productUsefullPos = (productsNbr /  productsUsefullNbr)|round %}
  150.                             {% endif %}
  151.                             {% set i = 0 %}
  152.                             {% set itemNum = 0 %}
  153.                             {% for item in result %}
  154.                                 {% set itemNum = itemNum + 1 %}
  155.                                 <div class="col-5-desk col-lg-3 col-md-4 col-6 mb-lg-5 mb-4">
  156.                                     {% set product = product_repository.find(item.id) %}
  157.                                     {% include '@SyliusShop/Product/_box.html.twig' with {'product': product, 'wishlist': wishlist} only %}
  158.                                 </div>
  159.                                 {% if productsUsefullNbr > 0 and i < productsUsefullNbr %}
  160.                                     {% if itemNum == productUsefullPos %}
  161.                                         {% for itemUsefull in taxon.productsUsefull|slice(i, i + 1) %}
  162.                                             {% set productUsefull = product_repository.find(itemUsefull.id) %}
  163.                                             {% if productUsefull.enabled %}
  164.                                                 <div class="col-5-desk col-lg-3 col-md-4 col-6 mb-lg-5 mb-4 article-usefull">
  165.                                                     {% include '@SyliusShop/Product/_box.html.twig' with {'product': productUsefull, 'wishlist': wishlist} only %}
  166.                                                 </div>
  167.                                             {% endif %}
  168.                                             {% set i = i + 1 %}
  169.                                         {% endfor %}
  170.                                         {% set itemNum = 0 %}
  171.                                     {% endif %}
  172.                                 {% endif %}
  173.                             {% endfor %}
  174.                             {% if productsUsefullNbr > 0 and i < productsUsefullNbr %}
  175.                                 {% for itemUsefull in taxon.productsUsefull|slice(i, i + 1) %}
  176.                                     {% set productUsefull = product_repository.find(itemUsefull.id) %}
  177.                                     {% if productUsefull.enabled %}
  178.                                         <div class="col-5-desk col-lg-3 col-md-4 col-6 mb-lg-5 mb-4 article-usefull">
  179.                                             {% include '@SyliusShop/Product/_box.html.twig' with {'product': productUsefull} only %}
  180.                                         </div>
  181.                                     {% endif %}
  182.                                     {% set i = i + 1 %}
  183.                                 {% endfor %}
  184.                             {% endif %}
  185.                         </div>
  186.                         {{ pagination.simple(result.paginator) }}
  187.                     </div>
  188.                     {% endif %}
  189.             </div>
  190.             {% if  taxon.translation.textSeo is defined %}
  191.                 <div class="text-grey font-15 py-lg-4 py-3 d-none d-md-block">
  192.                     {{ taxon.translation.textSeo|raw }}
  193.                 </div>
  194.             {% endif %}
  195.         </section>
  196.      </section>
  197. {% endblock %}