{% macro recursiveCategoryOption(category, options) %} {% set subCategories = getCategoryList({'parentCategory':category.id}) %} {% set viewCategoryAll = getCategoryOptionName(category.id) %} {% set activeCategory = options.activeCategory|default %} {% set parentCategory = options.parentCategory|default %} {% set activeCategoryIds = options.activeCategoryIds|default %} {% if viewCategoryAll and activeCategory.id|default != category.id %} {% endif %} {% if subCategories|length > 0 %} {% for c in subCategories %} {{ _self.recursiveCategoryOption(c,{'activeCategory':activeCategory|default,'parentCategory':parentCategory|default,'activeCategoryIds':activeCategoryIds|default}) }} {% endfor %} {% endif %} {% endmacro %} {% set categories = getCategoryList({'mainCategory':'1'}) %} {% if categories|length > 0 %} {% for k,c in categories %} {{ _self.recursiveCategoryOption(c,{'activeCategory':category|default,'parentCategory':parentCategory|default,'activeCategoryIds':activeCategoryIds|default}) }} {% endfor %} {% endif %}