{% if categories is not empty %}
    {% for category in categories %}
        <option value="{{ category.id }}"
                {% if config.selected is iterable %}
                    {% if category.id in config.selected %}
                        selected
                    {% endif %}
                {% else %}
                    {% if category.id == config.selected %}
                        selected
                    {% endif %}
                {% endif %}>
            {{ prefix }} {{ category.name }}
        </option>
        {% if config.show_subs %}
            {%
                include 'shop/category/option.twig' with {
                    categories: category.children().get(),
                    prefix: prefix ~ "-"
                }
            %}
        {% endif %}
    {% endfor %}
{% endif %}