{#
* Plugin Name : SearchPlus
*
* Copyright (C) BraTech Co., Ltd. All Rights Reserved.
* http://www.bratech.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
#}
<div id="search_plus" style="display:none;">
<br>
{% if search_form.maker_id is defined and search_form.vars.value.maker_id|length > 0 %}
<li class="ec-topicpath__item">{{ 'maker.admin.maker'|trans }}:
{% for Maker in search_form.vars.value.maker_id %}
{{ Maker.name }}{% if not loop.last %},{% endif %}
{% endfor %}
</li><br>
{% endif %}
{% if search_form.vars.value.tag_id|length > 0 %}
<li class="ec-topicpath__item">{{ 'searchplus.block.search_tag'|trans }}:
{% for Tag in search_form.vars.value.tag_id %}
{{ Tag }}{% if not loop.last %},{% endif %}
{% endfor %}
</li><br>
{% endif %}
{% if search_form.vars.value.pmin or search_form.vars.value.pmax %}
<li class="ec-topicpath__item">{{ 'searchplus.block.search_price'|trans }}:
{% endif %}
{% if search_form.vars.value.pmin %}
¥{{ search_form.vars.value.pmin|number_format }}
{% endif %}
{% if search_form.vars.value.pmin or search_form.vars.value.pmax %}~{% endif %}
{% if search_form.vars.value.pmax %}
¥{{ search_form.vars.value.pmax|number_format }}
{% endif %}
{% if search_form.vars.value.pmin or search_form.vars.value.pmax %}
</li><br>
{% endif %}
{% if search_form.vars.value.instock %}
<li class="ec-topicpath__item">{{ 'searchplus.block.label.instock'|trans }}</li><br>
{% endif %}
{% if ProductItems is defined %}
{% for ProductItem in ProductItems %}
{% if ProductItem.input_type == constant('Plugin\\ProductPlus\\Entity\\ProductItem::DATE_TYPE') %}
{% set name_start = 'productplus_' ~ ProductItem.id ~ '_date_start' %}
{% set name_end = 'productplus_' ~ ProductItem.id ~ '_date_end' %}
{% if search_form.vars.value[name_start] or search_form.vars.value[name_end] %}
<li class="ec-topicpath__item">{{ ProductItem.name }}:
{% endif %}
{% if search_form.vars.value[name_start] %}
{{ search_form.vars.value[name_start]|date('Y/m/d') }}
{% endif %}
{% if search_form.vars.value[name_start] or search_form.vars.value[name_end] %}~{% endif %}
{% if search_form.vars.value[name_end] %}
{{ search_form.vars.value[name_end]|date('Y/m/d') }}
{% endif %}
{% if search_form.vars.value[name_start] or search_form.vars.value[name_end] %}
</li><br>
{% endif %}
{% else %}
{% set name = 'productplus_' ~ ProductItem.id %}
{% if search_form.vars.value[name] is defined and search_form.vars.value[name] %}
{% if search_form.vars.value[name] is iterable %}
<li class="ec-topicpath__item">{{ ProductItem.name}}:
{% for choice in search_form[name].vars.choices %}
{% for data in search_form[name].vars.value %}
{% if choice.value == data %}{{ choice.label }}{% if not loop.last %},{% endif %}{% endif %}
{% endfor %}
{% endfor %}
</li><br>
{% else %}
<li class="ec-topicpath__item">{{ ProductItem.name}}:{{ search_form.vars.value[name] }}</li><br>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
</div>