templates/bundles/SyliusShopBundle/Product/index.html.twig line 55

Open in your IDE?
  1. {% extends '@SyliusShop/layout.html.twig' %}
  2. {% block content %}
  3.     <div class="header-image">
  4.         <img class="img-header-destock" src="{{ asset('header-image.png', 'shop') }}" alt="cover">
  5.         <img class="img-header-responsive" src="{{ asset('header-image-responsive.png', 'shop') }}" alt="cover">
  6.         <div class="text-header">
  7.                 {% if slug == null %}
  8.                     <h1>Boutique</h1>
  9.                     <ul>
  10.                         {% for taxons in taxons %}
  11.                             <li class="link-taxons-header"><a href="{{ path('sylius_shop_product_index', {slug : taxons.code}) }}">{{ taxons.translations.toArray()['fr_FR'].name }}</a></li>
  12.                         {% endfor %}
  13.                     </ul>
  14.                 {% elseif slug.code == 'categories' %}
  15.                     <h1>Boutique</h1>
  16.                     <ul>
  17.                         {% for taxons in taxons %}
  18.                             <li class="link-taxons-header"><a href="{{ path('sylius_shop_product_index', {slug : taxons.code}) }}">{{ taxons.translations.toArray()['fr_FR'].name }}</a></li>
  19.                         {% endfor %}
  20.                     </ul>
  21.                 {% else %}
  22.                     <div class="title-header">
  23.                         <h1>{{ slug.translations.toArray()['fr_FR'].name }}</h1>
  24.                         {% set ancestors = slug.ancestors|reverse %}
  25.                         <a href="{{ path('sylius_shop_product_index', {slug : ancestors[0].code}) }}">
  26.                             <svg width="39" height="29" viewBox="0 0 39 29" fill="none" xmlns="http://www.w3.org/2000/svg">
  27.                                 <path d="M14.75 0.25L18.075 3.69375L9.64375 12.125L38.5 12.125V16.875L9.64375 16.875L18.075 25.3063L14.75 28.75L0.499995 14.5L14.75 0.25Z" fill="white"/>
  28.                             </svg>
  29.                         </a>
  30.                     </div>
  31.                     <ul>
  32.                         {% for taxon in taxons %}
  33.                             {% if taxon.code == slug.code %}
  34.                             {% else %}
  35.                                 <li class="link-taxons-header"><a href="{{ path('sylius_shop_product_index', {slug : taxon.code}) }}">{{ taxon.translations.toArray()['fr_FR'].name }}</a></li>
  36.                             {% endif %}
  37.                         {% endfor %}
  38.                     </ul>
  39.                 {% endif %}
  40.         </div>
  41.     </div>
  42.     <div class="container-h" id="container-category-page">
  43.         {% include '@SyliusShop/Product/Index/_header.html.twig' %}
  44.         <div class="ui stackable grid">
  45.             <div class="four wide column" id="filtre-container">
  46.                 <div class="header-filter-responsive">
  47.                     <h3 class="title-category-page">Boutique</h3>
  48.                     <i class="x icon" id="close-icon-filter"></i>
  49.                 </div>
  50.                 {% include '@SyliusShop/Product/Index/_sidebar.html.twig' %}
  51.                 <form method="POST" action="{{ path('sylius_shop_product_index', {slug : 'categories'}) }}" class="form_category_index">
  52.                 {% include '@SyliusShop/Product/Index/pricebar.html.twig' %}
  53.                 {% include '@SyliusShop/Product/Index/colorbar.html.twig' %}
  54.                 {% include '@SyliusShop/Product/Index/sizebar.html.twig' %}
  55. {#                {% include '@SyliusShop/Product/Index/statebar.html.twig' %}#}
  56. {#                {% include '@SyliusShop/Product/Index/brandbar.html.twig' %}#}
  57. {#                {% include '@SyliusShop/Product/Index/vendortypebar.html.twig' %}#}
  58. {#                {% include '@SyliusShop/Product/Index/locationbar.html.twig' %}#}
  59.                     <button type="submit" class="submit-button-filter">Rechercher</button>
  60.                 </form>
  61.             </div>
  62.             <div class="twelve wide column" id="main-index-product">
  63.                 {% include '@SyliusShop/Product/Index/_main.html.twig' %}
  64.             </div>
  65.         </div>
  66.     </div>
  67.     <script>
  68.       function toggleDiv(divClass, toggleBtnClass) {
  69.         // Sélectionnez la div avec la classe donnée
  70.         const div = document.querySelector(`.${divClass}`);
  71.         // Sélectionnez le bouton à basculer avec la classe donnée
  72.         const toggleBtn = document.querySelector(`.${toggleBtnClass}`);
  73.         // Ajoutez un gestionnaire d'événements au clic sur le bouton à basculer
  74.         // toggleBtn.addEventListener('click', () => {
  75.           // Changez le style de la div pour la masquer ou l'afficher
  76.           div.style.display = (div.style.display === 'none') ? 'block' : 'none';
  77.           // Changez le texte du bouton à basculer en fonction de l'état de la div
  78.           toggleBtn.textContent = (div.style.display === 'none') ? '+' : '-';
  79.         // });
  80.       }
  81.     </script>
  82. {% endblock %}