{% sw_extends '@Storefront/storefront/layout/navigation/categories.html.twig' %}
{% block layout_navigation_categories_item_link %}
{# redirect to product if possible #}
{% if (treeItem.category.translated.customFields.wbn_category_settings_nav_products == 'active' and treeItem.category.extensions.wbnRedirectTo) %}
{% set link = seoUrl('frontend.detail.page', {'productId': treeItem.category.extensions.wbnRedirectTo.id}) %}
<a class="nav-item nav-link navigation-flyout-link is-level-{{ level }}{% if id == activeId or id in activePath %} active{% endif %} wbn-redirect"
href="{{ link }}"
itemprop="url"
title="{{ name }}">
<span itemprop="name">{{ name }}</span>
</a>
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block layout_navigation_categories_item %}
<div class="{% if level == 0 %}col-3{% endif %} navigation-flyout-col">
{{ block('layout_navigation_categories_item_link') }}
{{ block('layout_navigation_categories_recoursion') }}
</div>
{% endblock %}