diff --git a/src/Pyz/Yves/CatalogPage/Theme/default/components/molecules/filter-category/filter-category.twig b/src/Pyz/Yves/CatalogPage/Theme/default/components/molecules/filter-category/filter-category.twig index da52436428..fc234550a8 100644 --- a/src/Pyz/Yves/CatalogPage/Theme/default/components/molecules/filter-category/filter-category.twig +++ b/src/Pyz/Yves/CatalogPage/Theme/default/components/molecules/filter-category/filter-category.twig @@ -27,39 +27,43 @@ {% set quantity = filterValue.docCount %} {% endfor %} - {% if data.filterPath is not empty %} - {% set currentUrl = url(data.filterPath, {categoryPath: (app.request.attributes.get('categoryPath'))}) %} - {% else %} - {% set currentUrl = app.request.attributes.get('categoryNode') ? app.request.attributes.get('categoryNode').url : null %} - {% endif %} + {% if (quantity > 0) or (quantity <= 0 and data.isEmptyCategoryFilterValueVisible == true) %} - {% set categoryUrl = data.filterPath is not empty ? url(data.filterPath, {categoryPath: (categoryNode.url | trimLocale)}) : categoryNode.url %} - {% set isActive = (currentUrl == categoryUrl) %} - {% set isHidden = (data.levelMenu != 1) %} - {% set disableAttribute = quantity == 0 ? 'disabled' %} - {% set menuItemActiveClass = isActive ? config.name ~ '__menu-item--active ' ~ config.jsName ~ '__menu-item' %} - {% set menuItemHiddenClass = isHidden and not isActive ? 'is-hidden-lg-xxl' %} - {% set menuLinkActiveClass = isActive ? config.name ~ '__menu-link--active' %} - {% set linkTextActiveClass = isActive ? config.name ~ '__link-text--active' %} - {% set triggerButtonJsName = data.parentJsName ? data.parentJsName ~ '__trigger' %} + {% if data.filterPath is not empty %} + {% set currentUrl = url(data.filterPath, {categoryPath: (app.request.attributes.get('categoryPath'))}) %} + {% else %} + {% set currentUrl = app.request.attributes.get('categoryNode') ? app.request.attributes.get('categoryNode').url : null %} + {% endif %} -