templates/web/customer/common/select_category.twig line 1

Open in your IDE?
  1. {##
  2.  # Category selection dropdown box template
  3.  #}
  4. <select
  5.   name="{{ this.getParam('fieldName') }}"
  6.   size="{{ this.getParam('size') }}"
  7.   {% if this.getFieldId() %}
  8.     id="{{ this.getFieldId() }}"
  9.   {% endif %}
  10.   {% if this.get('nonFixed')  %}
  11.     style="width:200pt" class="form-control"
  12.   {% else %}
  13.     class="FixedSelect form-control"
  14.   {% endif %}
  15. >
  16.   {% if this.getParam('allOption') %}
  17.     <option value="">{{ t('All') }}</option>
  18.   {% endif %}
  19.   {% if this.getParam('noneOption') %}
  20.     <option value="no_category">{{ t('Not assigned') }}</option>
  21.   {% endif %}
  22.   {% if this.getParam('rootOption') %}
  23.     <option value="" class="CenterBorder">{{ t('Root level') }}</option>
  24.   {% endif %}
  25.     {% for key, category in this.getCategories() %}
  26.     {% if this.getArrayField(category, 'category_id') != this.getParam('currentCategoryId') %}
  27.       <option value="{{ this.getArrayField(category, 'category_id') }}"
  28.         {% if this.isCategorySelected(category) %} selected="selected" {% endif %}>
  29.           {{ this.getIndentationString(category, 3, '-') }} {{ this.getCategoryName(category)|raw }}
  30.       </option>
  31.     {% endif %}
  32.   {% endfor %}
  33.   {% if this.isDisplayNoCategories() %}
  34.     <option value="">{{ t('-- No categories --') }}</option>
  35.   {% endif %}
  36. </select>