<div class="categlistcontainer">
<div style="margin-bottom: 15px;">
{% if searchObject.categid is null %}
<div class="categactive" style="margin-bottom: 10px;">
{% else %}
<div class="categinactive" style="margin-bottom: 10px;">
{% endif %}
<a href="{{ path('product_index') }}">{{ 'product.all_products'|trans }}</a>
</div>
{% for categTree in categsTree if categsTree is not empty %}
{% if categTree.id == searchObject.categid.id %}
<div class="categactive" style="margin-left: {{ loop.index0 * 20 }}px;">
<div class="categlabelselected">
{% else %}
<div class="categinactive">
{% endif %}
<a href="{{ path('product_index', {categid: categTree.id, brandid: 0}) }}">{{ categTree.name }}</a><br>
{% if categTree.id == searchObject.categid.id %}</div></div>{% else %}</div>{% endif %}
{% endfor %}
{% for category in categories %}
{% if searchObject.categid is not null %}
<div style="margin-left: 20px;">
{% endif %}
<a href="{{ path('product_index', app.request.query.all|merge({categid: category.id})) }}">{{ category.name }}</a><br>
{% if searchObject.categid is not null %}
</div>
{% endif %}
{% endfor %}
{% if searchObject.categid is not null %}
<div class="sep1"></div>
<div style="margin-bottom: 15px;">
<b>{{ 'product.brands'|trans }} :</b><br>
{% if searchObject.brandid is null %}
<div class="categactive categlabelselected" style="margin-bottom: 10px;">
{% else %}
<div class="categinactive" style="margin-bottom: 10px;">
{% endif %}
{% set params = app.request.query.all | filter((v, k) => k != 'brandid') %}
<a href="{{ path('product_index', params) }}">{{ 'product.all_brands'|trans }}</a>
</div>
{% for brand in brands %}
{% if searchObject.brandid is not null and searchObject.brandid.id == brand.id %}
<div class="categactive categlabelselected">
{% else %}
<div class="categinactive">
{% endif %}
<a href="{{ path('product_index', app.request.query.all|merge({brandid: brand.id})) }}">{{ brand.name }}</a><br>
</div>
{% endfor %}
<div style="margin-top: 5px;">
<a href="{{ path('brand_list', {categid: searchObject.categid.id}) }}">{{ 'product.see_more'|trans }}</a>
</div>
</div>
{% endif %}
{% if attributes is not empty %}
<div style="margin-bottom: 15px;">
<b>{{ 'product.attributes'|trans }}</b><br>
{% for attribute in attributes %}
<div>{{ attribute.name }}</div>
<div style="margin-left: 10px;">
{% for option in attribute.options %}
{% if searchObject.opt is not null and searchObject.opt.id == option.id %}
{% set params = app.request.query.all | filter((v, k) => k != 'opt' and k != 'addattrib') %}
<div style="padding-left: 5px; background: #fad895; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;">
<img src="{{ asset('images/main/icons/cancel.png') }}" alt="" /> <a href="{{ path('product_index', params) }}">{{ option.name }}</a>
</div>
{% else %}
<div>
<a href="{{ path('product_index', app.request.query.all|merge({addattrib: attribute.id, opt: option.id})) }}">{{ option.name }}</a>
</div>
{% endif %}
{% endfor %}
</div>
{% endfor %}
</div>
{% endif %}
<br>
{{ form_start(searchForm) }}
{{ form_rest(searchForm) }}
<div class="form-actions">
<button type="submit">{{ 'actions.search'|trans }}</button>
</div>
{{ form_end(searchForm) }}
</div>
</div>