{% set registerProductsLink = url('sylius_shop_login') %}
{% if is_granted('ROLE_USER') %}
{% if app.user.customer.organization.vendor|default(null) == null %}
{% set registerProductsLink = url('open_marketplace_vendor_register_form') %}
{% else %}
{% set registerProductsLink = url('open_marketplace_vendor_product_listings_index') %}
{% endif %}
{% endif %}
{% macro item(taxon) %}
{% import _self as macros %}
{% set children = taxon.getEnabledChildrenByTranslationName(taxon.translation.locale) %}
{% if children|length > 0 %}
<div class="accordion transition visible">
<div class="title">
<a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}" class="menu-title-link">
{{ taxon.name }}
</a>
<span class="material-symbols-outlined toggle-icon">
expand_more
</span>
</div>
<div class="content">
{% for childTaxon in children %}
{{ macros.item(childTaxon) }}
{% endfor %}
</div>
</div>
{% else %}
<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>
{% endif %}
{% endmacro %}
{% import _self as macros %}
{% if taxons|length > 0 %}
{% for taxon in taxons %}
{{ macros.item(taxon) }}
{% endfor %}
{{ render(path('open_marketplace_shop_render_country_menu', {'template': '@SyliusShop/Layout/Sidebar/Menu/country.html.twig'})) }}
<a href="{{ path('open_marketplace_shop_vendor_index') }}" class="accordion-link item font-bold">{{ 'app.ui.brands'|trans }}</a>
{{ render(path('open_marketplace_shop_render_use_case_menu', {'template': '@SyliusShop/Layout/Sidebar/Menu/useCase.html.twig'})) }}
<a href="{{ registerProductsLink }}" class="accordion-link item font-bold">{{ 'app.ui.register_products'|trans }}</a>
{% endif %}