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.                 {{ taxon.name }}
  16.                 <span class="material-symbols-outlined">expand_more</span>
  17.             </div>
  18.             <div class="content">
  19.                 {% for childTaxon in children %}
  20.                     {{ macros.item(childTaxon) }}
  21.                 {% endfor %}
  22.             </div>
  23.         </div>
  24.     {% else %}
  25.         <a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}" class="accordion-link item font-bold">{{ taxon.name }}</a>
  26.     {% endif %}
  27. {% endmacro %}
  28. {% import _self as macros %}
  29. {% if taxons|length > 0 %}
  30.     {% for taxon in taxons %}
  31.         {{ macros.item(taxon) }}
  32.     {% endfor %}
  33.     {{ render(path('open_marketplace_shop_render_country_menu', {'template': '@SyliusShop/Layout/Sidebar/Menu/country.html.twig'})) }}
  34.     <a href="{{ path('open_marketplace_shop_vendor_index') }}" class="accordion-link item font-bold">{{ 'app.ui.brands'|trans }}</a>
  35.     {{ render(path('open_marketplace_shop_render_use_case_menu', {'template': '@SyliusShop/Layout/Sidebar/Menu/useCase.html.twig'})) }}
  36.     <a href="{{ registerProductsLink }}" class="accordion-link item font-bold">{{ 'app.ui.register_products'|trans }}</a>
  37. {% endif %}