templates/product/partials/sidebar_product_list.html.twig line 1

Open in your IDE?
  1. <div class="categlistcontainer">
  2.     <div style="margin-bottom: 15px;">
  3.         {% if searchObject.categid is null %}
  4.         <div class="categactive" style="margin-bottom: 10px;">
  5.         {% else %}
  6.         <div class="categinactive" style="margin-bottom: 10px;">
  7.         {% endif %}
  8.             <a href="{{ path('product_index') }}">{{ 'product.all_products'|trans }}</a>
  9.         </div>
  10.         {% for categTree in categsTree if categsTree is not empty %}
  11.             {% if categTree.id == searchObject.categid.id %}
  12.                 <div class="categactive" style="margin-left: {{ loop.index0 * 20 }}px;">
  13.                 <div class="categlabelselected">
  14.             {% else %}
  15.                 <div class="categinactive">
  16.             {% endif %}
  17.             <a href="{{ path('product_index', {categid: categTree.id, brandid: 0}) }}">{{ categTree.name }}</a><br>
  18.             {% if categTree.id == searchObject.categid.id %}</div></div>{% else %}</div>{% endif %}
  19.         {% endfor %}
  20.         {% for category in categories %}
  21.             {% if searchObject.categid is not null %}
  22.                 <div style="margin-left: 20px;">
  23.             {% endif %}
  24.             <a href="{{ path('product_index', app.request.query.all|merge({categid: category.id})) }}">{{ category.name }}</a><br>
  25.             {% if searchObject.categid is not null %}
  26.                 </div>
  27.             {% endif %}
  28.         {% endfor %}
  29.         {% if searchObject.categid is not null %}
  30.         <div class="sep1"></div>
  31.         <div style="margin-bottom: 15px;">
  32.             <b>{{ 'product.brands'|trans }} :</b><br>
  33.             {% if searchObject.brandid is null %}
  34.             <div class="categactive categlabelselected" style="margin-bottom: 10px;">
  35.             {% else %}
  36.             <div class="categinactive" style="margin-bottom: 10px;">
  37.             {% endif %}
  38.             {% set params = app.request.query.all | filter((v, k) => k != 'brandid') %}
  39.                 <a href="{{ path('product_index', params) }}">{{ 'product.all_brands'|trans }}</a>
  40.             </div>
  41.             {% for brand in brands %}
  42.                 {% if searchObject.brandid is not null and searchObject.brandid.id == brand.id %}
  43.                 <div class="categactive categlabelselected">
  44.                 {% else %}
  45.                 <div class="categinactive">
  46.                 {% endif %}
  47.                     <a href="{{ path('product_index', app.request.query.all|merge({brandid: brand.id})) }}">{{ brand.name }}</a><br>
  48.                 </div>
  49.             {% endfor %}
  50.             <div style="margin-top: 5px;">
  51.                 <a href="{{ path('brand_list', {categid: searchObject.categid.id}) }}">{{ 'product.see_more'|trans }}</a>
  52.             </div>
  53.         </div>
  54.         {% endif %}
  55.         {% if attributes is not empty %}
  56.         <div style="margin-bottom: 15px;">
  57.             <b>{{ 'product.attributes'|trans }}</b><br>
  58.             {% for attribute in attributes %}
  59.                 <div>{{ attribute.name }}</div>
  60.                 <div style="margin-left: 10px;">
  61.                     {% for option in attribute.options %}
  62.                         {% if searchObject.opt is not null and searchObject.opt.id == option.id %}
  63.                             {% set params = app.request.query.all | filter((v, k) => k != 'opt' and k != 'addattrib') %}
  64.                             <div style="padding-left: 5px; background: #fad895; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;">
  65.                                 <img src="{{ asset('images/main/icons/cancel.png') }}" alt="" /> <a href="{{ path('product_index', params) }}">{{ option.name }}</a>
  66.                             </div>
  67.                         {% else %}
  68.                             <div>
  69.                                 <a href="{{ path('product_index', app.request.query.all|merge({addattrib: attribute.id, opt: option.id})) }}">{{ option.name }}</a>
  70.                             </div>
  71.                         {% endif %}
  72.                     {% endfor %}
  73.                 </div>
  74.             {% endfor %}
  75.         </div>
  76.         {% endif %}
  77.         <br>
  78.         {{ form_start(searchForm) }}
  79.         {{ form_rest(searchForm) }}
  80.         <div class="form-actions">
  81.             <button type="submit">{{ 'actions.search'|trans }}</button>
  82.         </div>
  83.         {{ form_end(searchForm) }}
  84.     </div>
  85. </div>