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

Open in your IDE?
  1. {% extends '@SyliusShop/layout.html.twig' %}
  2. {% import '@SyliusUi/Macro/pagination.html.twig' as pagination %}
  3. {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
  4. {% block title %}
  5.     {% if taxon is defined and taxon.translation.metaTitle is not null and taxon.translation.metaTitle != "" %}
  6.         {{ taxon.translation.metaTitle }}
  7.     {% else %}
  8.         {% if app_get_page_meta_by_code("taxon",{ 'taxon': taxon }) is not empty %}
  9.             {% set meta = app_get_page_meta_by_code("taxon", { 'taxon': taxon }) %}
  10.             {% if meta.title is not null %}
  11.                 {{ meta.title }}
  12.             {% else %}
  13.                 {{ parent() }}
  14.             {% endif %}
  15.         {% else %}
  16.             {{ parent() }}
  17.         {% endif %}
  18.     {% endif %}
  19. {% endblock %}
  20. {% block metatags %}
  21.     {% if taxon is defined and taxon.translation.metaDescription is not null and taxon.translation.metaTitle != "" %}
  22.         <meta name="description" content="{{ taxon.translation.metaDescription }}">
  23.     {% else %}
  24.         {% if app_get_page_meta_by_code("taxon", { 'taxon': taxon}) is not empty %}
  25.             {% set meta = app_get_page_meta_by_code("taxon", { 'taxon': taxon }) %}
  26.             {% if meta.metaDescription is not null %}
  27.                 <meta name="description" content="{{ meta.metaDescription }}">
  28.             {% else %}
  29.                 {{ parent() }}
  30.             {% endif %}
  31.             {% if meta.metaRobotIndex == true %}
  32.                 {% set metaRobotIndex = 'index, follow' %}
  33.             {% elseif meta.metaRobotIndex == false %}
  34.                 {% set metaRobotIndex = 'noindex, nofollow' %}
  35.             {% endif %}
  36.             <meta name="robots" content="{{ metaRobotIndex }}"/>
  37.         {% else %}
  38.             {{ parent() }}
  39.         {% endif %}
  40.     {% endif %}
  41. {% endblock %}
  42. {% block content %}
  43.     {% set missingAmountFranco = app_get_missing_franco_port() %}
  44.     <div class="page-categorie-content">
  45.         <div class="categorie-top">
  46.             <div class="max-container-4 px-0">
  47.                 {% include '@SyliusShop/Product/Index/_sidebar.html.twig' %}
  48.             </div>
  49.         </div>
  50.         <div class="max-container-4 px-xl-0">
  51.             <div class="categ-bottom">
  52.                 {% if result.count == 0 %}
  53.                     <div class="my-3 px-2 text-center pt-4 no-result">
  54.                         <div class="d-inline-block">
  55.                             <div class="alert alert-danger">
  56.                                 {{ 'app.common.aucun_produit_disponible'|trans }}
  57.                             </div>
  58.                         </div>
  59.                     </div>
  60.                 {% else %}
  61.                     <div class="px-0">
  62.                         <div class="filtre-cat d-none">
  63.                             {% include '@MonsieurBizSyliusSearchPlugin/Search/_sidebar.html.twig' %}
  64.                         </div>
  65.                         <div class="res-filtre  fontsize-mobile-text pb-0 pt-md-0 pt-3 d-none ">
  66.                             <div class="d-flex align-items-center justify-content-md-start justify-content-between">
  67.                                 <div class="order-md-12 d-none d-md-block">
  68.                                     <h2 class="d-inline-block text-sofiaMedium" style="font-size: 1.2rem; margin-bottom: 0;">{{ "app.ui.your_selection"|trans }} :</h2>
  69.                                     {% for filter in result.filters %}
  70.                                         {% for value in filter.values %}
  71.                                             {% if value.isApplied and filter.type != "range" %}
  72.                                                 <div class="d-inline-block delete-filter cursor-pointer" data-filter="{{ 'filter-' ~ filter.code ~ '-value-' ~ value.slug }}" ><span>{{ value.label}} <i class="icon-cancel color-orange"></i></span></div>
  73.                                             {% endif %}
  74.                                         {% endfor %}
  75.                                     {% endfor %}
  76.                                 </div>
  77.                                 <div class="order-md-1 pt-sm-0 pt-2"><strong class="nbre-article fontsize-mobilesm-text ">{{ result.count}} {{ "app.ui.products"|trans|lower }} </strong></div>
  78.                                 <div class="d-md-none_ d-block_ d-none mobile-label-filtre">{{ "app.ui.sort_per"|trans|capitalize }} <i class="icon-down-open-big"></i></div>
  79.                             </div>
  80.                         </div>
  81.                     </div>
  82.                     <div class="liste-articles pt-lg-4 pt-md-3 pt-2 pb-md-4 pb-2 mt-xl-2 px-md-0 px-perso-top">
  83.                         <div class="row mx-0" id="products">
  84.                             <div class="col-xl-perso col-lg-3 col-md-4 col-6 mb-3 px-0">
  85.                                 <div class="h-100 pb-sm-3 pt-perso-10">
  86.                                     <a href="#" class="link-free-delivery d-flex align-items-center justify-content-center h-100 flex-column transition-bgcolor">
  87.                                         {{ "app.ui.free_delivery"|trans|raw }}
  88.                                         <em>{{ money.convertAndFormat(missingAmountFranco) }}</em>
  89. {#                                        <em>{{ "app.ui.from"|trans }} 60€</em>#}
  90. {#                                        {{'app.cart.missing_x_for_franco'|trans}} <span class="color-pink-s">{{ money.convertAndFormat(missingAmountFranco) }}</span> {{'app.cart.before_free_shipping'|trans}}#}
  91.                                     </a>
  92.                                 </div>
  93.                             </div>
  94.                             {% set productsUsefullNbr = taxon.productsUsefull.count %}
  95.                             {% set productsNbr = result.count %}
  96.                             {% if productsUsefullNbr == 1 %}
  97.                                 {% set productUsefullPos = (productsNbr /  2)|round %}
  98.                             {% elseif productsUsefullNbr > 0 %}
  99.                                 {% set productUsefullPos = (productsNbr /  productsUsefullNbr)|round %}
  100.                             {% endif %}
  101.                             {% set i = 0 %}
  102.                             {% set itemNum = 0 %}
  103.                             {% for item in result %}
  104.                                 {% set itemNum = itemNum + 1 %}
  105.                                 <div class="col-xl-perso col-lg-3 col-md-4 col-6 mb-3 px-0">
  106.                                     {% set product = product_repository.find(item.id) %}
  107.                                     {% include '@SyliusShop/Product/_box.html.twig' with {'product': product} only %}
  108.                                 </div>
  109.                                 {% if productsUsefullNbr > 0 and i < productsUsefullNbr %}
  110.                                     {% if itemNum == productUsefullPos %}
  111.                                         {% for itemUsefull in taxon.productsUsefull|slice(i, i + 1) %}
  112.                                             {% set productUsefull = product_repository.find(itemUsefull.id) %}
  113.                                             {% if productUsefull.enabled %}
  114.                                             <div class="col-xl-perso col-lg-3 col-md-4 col-6 mb-3 px-0 article-usefull">
  115.                                                 {% include '@SyliusShop/Product/_box.html.twig' with {'product': productUsefull} only %}
  116.                                             </div>
  117.                                             {% endif %}
  118.                                             {% set i = i + 1 %}
  119.                                         {% endfor %}
  120.                                         {% set itemNum = 0 %}
  121.                                     {% endif %}
  122.                                 {% endif %}
  123.                             {% endfor %}
  124.                             {% if productsUsefullNbr > 0 and i < productsUsefullNbr %}
  125.                                 {% for itemUsefull in taxon.productsUsefull|slice(i, i + 1) %}
  126.                                     {% set productUsefull = product_repository.find(itemUsefull.id) %}
  127.                                     {% if productUsefull.enabled %}
  128.                                         <div class="col-xl-perso col-lg-3 col-md-4 col-6 mb-3 px-0 article-usefull">
  129.                                             {% include '@SyliusShop/Product/_box.html.twig' with {'product': productUsefull} only %}
  130.                                         </div>
  131.                                     {% endif %}
  132.                                     {% set i = i + 1 %}
  133.                                 {% endfor %}
  134.                             {% endif %}
  135.                         </div>
  136.                         {{ pagination.simple(result.paginator) }}
  137.                     </div>
  138.                     {% if taxon.translation.textSEO is not empty %}
  139. {#                        <div class="texte-gris fontsize-mobile-text text-regular-onlg pt-2 font-texte-normale pt-md-2 pt-0   mp-0 pb-xl-4 pb-md-3">#}
  140. {#                            {{ taxon.translation.textSEO|raw }}#}
  141.                         <div class="texte-gris fontsize-mobile-text text-regular-onlg pt-2  font-texte-normale pt-md-2 pt-0   mp-0 pb-xl-4 pb-md-3 ">
  142.                             <div class="texte-seo">
  143.                                 {{ taxon.translation.textSEO|raw }}
  144.                             </div>
  145.                         </div>
  146.                     {% endif %}
  147.                     {% if taxon.productsAssociated|length > 0 %}
  148.                         <div class="pt-lg-4 pt-2">
  149.                             <h2 class="titre-medium text-uppercase max-after"><span>{{'app.ui.products_associated'|trans}}</span></h2>
  150.                             <div class="contenu-art-top">
  151.                                 <div class="selection-prev prev-top"></div>
  152.                                 <div class="selection-next next-top"></div>
  153.                                 <div id="sylius-carouselselection" class="top-nouvselection swiper-container product-swiper-container">
  154.                                     <div class="swiper-wrapper">
  155.                                         {% for product in taxon.productsAssociated %}
  156.                                             <div class="produit-selection-item swiper-slide">
  157.                                                 <div class="">
  158.                                                     {% include '@SyliusShop/Product/_box.html.twig' %}
  159.                                                 </div>
  160.                                             </div>
  161.                                         {% endfor %}
  162.                                     </div>
  163.                                     <div class="swiper-pagination"></div>
  164.                                 </div>
  165.                             </div>
  166.                         </div>
  167.                     {% endif %}
  168.                 {% endif %}
  169.             </div>
  170.         </div>
  171.     </div>
  172. {% endblock %}