templates/bundles/SyliusShopBundle/Taxon/verticalMenu.html.twig line 1

Open in your IDE?
  1. {% set registerProductsLink = url('sylius_shop_login') %}
  2. {% if is_granted('ROLE_USER') %}
  3.     {% if app.user.customer.organization.vendor|default(null) == null %}
  4.         {% set registerProductsLink = url('open_marketplace_vendor_register_form') %}
  5.     {% else %}
  6.         {% set registerProductsLink = url('open_marketplace_vendor_product_listings_index') %}
  7.     {% endif %}
  8. {% endif %}
  9. {% macro item(taxon) %}
  10.     {% import _self as macros %}
  11.     {% set children = taxon.getEnabledChildrenByTranslationName(taxon.translation.locale) %}
  12.     {% if children|length > 0 %}
  13.         <div class="accordion transition visible">
  14.             <div class="title">
  15.                 <a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}" class="menu-title-link">
  16.                     {{ taxon.name }}
  17.                 </a>
  18.                 <span class="material-symbols-outlined toggle-icon">
  19.                     expand_more
  20.                 </span>
  21.             </div>
  22.             <div class="content">
  23.                 {% for childTaxon in children %}
  24.                     {{ macros.item(childTaxon) }}
  25.                 {% endfor %}
  26.             </div>
  27.         </div>
  28.     {% else %}
  29.         <a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}" class="accordion-link item font-bold">
  30.             {{ taxon.name }}
  31.         </a>
  32.     {% endif %}
  33. {% endmacro %}
  34. {% import _self as macros %}
  35. {% if taxons|length > 0 %}
  36.     {% for taxon in taxons %}
  37.         {{ macros.item(taxon) }}
  38.     {% endfor %}
  39.     {{ render(path('open_marketplace_shop_render_country_menu', {'template': '@SyliusShop/Layout/Sidebar/Menu/country.html.twig'})) }}
  40.     <a href="{{ path('open_marketplace_shop_vendor_index') }}" class="accordion-link item font-bold">{{ 'app.ui.brands'|trans }}</a>
  41.     {{ render(path('open_marketplace_shop_render_use_case_menu', {'template': '@SyliusShop/Layout/Sidebar/Menu/useCase.html.twig'})) }}
  42.     <a href="{{ registerProductsLink }}" class="accordion-link item font-bold">{{ 'app.ui.register_products'|trans }}</a>
  43. {% endif %}