File: /home/retile.ru/public_html/catalog/view/theme/unishop2/template/product/search.twig
{{ header }}
<div class="container">
<div class="breadcrumb-h1 {{ menu_expanded ? ' col-md-offset-3 col-lg-offset-3 col-xxl-offset-4' }}">
<ul class="breadcrumb mobile">
{% for key, breadcrumb in breadcrumbs %}
{% if key + 1 < breadcrumbs|length %}
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
{% else %}
{% if not hide_last_breadcrumb or (hide_last_breadcrumb and key == 1) %}<li>{{ breadcrumb.text }}</li>{% endif %}
{% endif %}
{% endfor %}
</ul>
<h1 class="heading">{{ heading_title }}</h1>
</div>
<div class="row">
{{ column_left }}
{% if column_left and column_right %}
{% set class = ' col-sm-4 col-md-6 col-lg-6 col-xxl-12' %}
{% elseif column_left or column_right %}
{% set class = ' col-sm-8 col-md-9 col-lg-9 col-xxl-16' %}
{% else %}
{% set class = ' col-sm-12' %}
{% endif %}
<div id="content" class="{{ class }}">
{{ content_top }}
<div class="uni-wrapper">
<div class="search-page__search-block">
<div class="row-flex">
<div class="search-page__search-input">
<input type="text" name="search" value="{{ search }}" placeholder="{{ text_keyword }}" id="input-search" class="form-control" />
<button type="button" class="search-btn-clear {{ search ? ' show' }}">×</button>
</div>
<div class="search-page__search-delimiter visible-xs"></div>
<div class="search-page__search-category">
<select name="category_id" class="form-control">
<option value="0">{{ text_category }}</option>
{% for category_1 in categories %}
{% if category_1.category_id == category_id %}
<option value="{{ category_1.category_id }}" selected="selected">{{ category_1.name }}</option>
{% else %}
<option value="{{ category_1.category_id }}">{{ category_1.name }}</option>
{% endif %}
{% for category_2 in category_1.children %}
{% if category_2.category_id == category_id %}
<option value="{{ category_2.category_id }}" selected="selected"> {{ category_2.name }}</option>
{% else %}
<option value="{{ category_2.category_id }}"> {{ category_2.name }}</option>
{% endif %}
{% for category_3 in category_2.children %}
{% if category_3.category_id == category_id %}
<option value="{{ category_3.category_id }}" selected="selected"> {{ category_3.name }}</option>
{% else %}
<option value="{{ category_3.category_id }}"> {{ category_3.name }}</option>
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
</select>
</div>
<div class="search-page__search-delimiter visible-xs"></div>
<div class="search-page__search-button">
<button type="button" id="button-search" class="btn btn-primary btn-xl btn-block"><span>{{ button_search }}</span></button>
</div>
</div>
{% if uni_search is empty %}
<br />
<div class="row-flex">
<label class="checkbox-inline input">
<input type="checkbox" name="sub_category" value="1" {% if sub_category %}checked="checked"{% endif %} />{{ text_sub_category }}
</label>
<div style="width:20px"></div>
<label class="checkbox-inline input">
<input type="checkbox" name="description" value="1" id="description" {% if description %}checked="checked"{% endif %} />{{ entry_description }}
</label>
</div>
{% endif %}
</div>
{% if manufacturers_search %}
<div class="heading">{{ text_search_manufacturer }}</div>
<div class="category-list row row-flex">
{% for manufacturer in manufacturers_search %}
<div class="{{ subcategory_column }}">
<a href="{{ manufacturer.href }}" class="category-list__item {{ manufacturer.thumb ? ' uni-item' : 'uni-item-bg' }}">
{% if manufacturer.thumb %}
<img src="{{ manufacturer.thumb }}" alt="{{ manufacturer.name }}" title="{{ manufacturer.name }}" class="category-list__img img-responsive" />
{% else %}
<span class="category-list__name">{{ manufacturer.name }}</span>
{% endif %}
</a>
</div>
{% endfor %}
</div>
{% endif %}
{% if categories_search %}
<div class="heading">{{ text_search_category }}</div>
<div class="category-list row row-flex">
{% for category in categories_search %}
<div class="{{ subcategory_column }}">
<a href="{{ category.href }}" class="category-list__item {{ category.thumb ? ' uni-item' : ' uni-item-bg' }}">
{% if category.thumb %}<img src="{{ category.thumb }}" alt="{{ category.name }}" title="{{ category.name }}" class="category-list__img img-responsive" />{% endif %}
<span class="category-list__name">{{ category.name }}</span>
</a>
</div>
{% endfor %}
</div>
{% endif %}
{% if products %}
<div class="heading">{{ text_search_product }}</div>
{% if product_categories_search %}
<div class="product-category-list">
<h4>{{ text_search_product_category }}</h4>
{% for category in product_categories_search %}
<a href="{{ category.href }}" class="product-category-list__item">{{ category.name }}</a>
{% endfor %}
</div>
{% endif %}
<div class="sorts-block">
<div class="sorts-block__wrapper">
<div class="sorts-block__sorts hidden-xs hidden-sm">
<span data-href="{{ sorts[0].href }}" class="sorts-block__span uni-href {{ sort in sorts[0].value ? ' selected' }}">{{ sorts.0.text }}</span>
{% for key, sorts in sorts %}
{% if key != 0 and sort in sorts.value and order not in sorts.value %}
<span data-href="{{ sorts.href }}" class="sorts-block__span uni-href selected {{ 'ASC' in sorts.value ? ' up' : ' down' }}">{{ sorts.text|split('(')[0] }}</span>
{% elseif key != 0 and sort not in sorts.value and 'DESC' not in sorts.value %}
<span data-href="{{ sorts.href }}" class="sorts-block__span uni-href">{{ sorts.text|split('(')[0] }}</span>
{% endif %}
{% endfor %}
</div>
<select id="input-sort" class="sorts-block__select form-control visible-xs visible-sm" onchange="location = this.value;">
{% for sorts in sorts %}
{% if sorts.value == '%s-%s'|format(sort, order) %}
<option value="{{ sorts.href }}" selected="selected">{{ sorts.text }}</option>
{% else %}
<option value="{{ sorts.href }}">{{ sorts.text }}</option>
{% endif %}
{% endfor %}
</select>
<select id="input-limit" class="sorts-block__select sorts-block__limit form-control" onchange="location = this.value;">
{% for limits in limits %}
{% if limits.value == limit %}
<option value="{{ limits.href }}" selected="selected">{{ limits.text }}</option>
{% else %}
<option value="{{ limits.href }}">{{ limits.text }}</option>
{% endif %}
{% endfor %}
</select>
<div class="sorts-block__btn-group btn-group">
{% if show_grid_button %}<button type="button" id="grid-view" class="sorts-block__btn btn btn-lg btn-default" title="{{ button_grid }}"><i class="fa fa-th-large"></i></button>{% endif %}
{% if show_list_button %}<button type="button" id="list-view" class="sorts-block__btn btn btn-lg btn btn-default" title="{{ button_list }}"><i class="fa fa-th-list"></i></button>{% endif %}
{% if show_compact_button %}<button type="button" id="compact-view" class="sorts-block__btn btn btn-lg btn btn-default hidden-xs hidden-sm" title="{{ button_compact }}"><i class="fa fa-align-justify"></i></button>{% endif %}
</div>
</div>
</div>
<hr />
<div class="products-block row row-flex">
{% if default_view == 'list' %}
{% set class = ' product-list list-view col-sm-12' %}
{% elseif default_view == 'compact' %}
{% set class = ' product-price compact-view col-sm-12' %}
{% else %}
{% if column_left and column_right %}
{% set class = ' product-grid grid-view col-sm-12 col-md-12 col-lg-6 col-xxl-6-1' %}
{% elseif column_left or column_right %}
{% set class = ' product-grid grid-view col-sm-6 col-md-4 col-lg-4 col-xxl-5' %}
{% else %}
{% set class = ' product-grid grid-view col-sm-6 col-md-3 col-lg-3 col-xxl-4' %}
{% endif %}
{% endif %}
{% for product in products %}
<div class="product-layout {{ class }}">
<div class="product-thumb uni-item">
<div class="product-thumb__image" {{ product.special_date_end ? ' data-special-end="'~product.special_date_end~'"' }}>
{% include 'unishop2/template/extension/module/uni_stickers.twig' %}
<a href="{{ product.href }}">
<img src="{{ product.thumb }}" {{ product.additional_image ? ' data-additional="'~product.additional_image~'"' }} alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive" />
</a>
</div>
<div class="product-thumb__caption">
<a class="product-thumb__name" href="{{ product.href }}">{{ product.name }}</a>
{{ product.model ? '<div class="product-thumb__model" data-text="'~text_model~'">'~product.model~'</div>' }}
{% if product.show_description %}
<div class="product-thumb__description description">{{ product.description }}</div>
{% endif %}
{% include 'unishop2/template/extension/module/uni_attributes.twig' %}
{% include 'unishop2/template/extension/module/uni_options.twig' %}
{% include 'unishop2/template/extension/module/uni_quantity_indicator.twig' %}
{% if product.rating >= 0 and show_rating %}
<div class="product-thumb__rating rating">
{% for i in 1..5 %}
<i class="{{ product.rating < i ? 'far fa-star' : 'fa fa-star' }}"></i>
{% endfor %}
{% if product.num_reviews > 0 %}<a class="product-thumb__rating-a uni-badge uni-href" data-href="{{ product.href }}#tab-review">{{ product.num_reviews }}</a>{% endif %}
</div>
{% endif %}
{% if product.price %}
<div class="product-thumb__price price" data-price="{{ product.price_value }}" data-special="{{ product.special_value }}" data-discount="{{ product.discounts }}">
{% if not product.special %}
{{ product.price }}
{% else %}
<span class="price-old">{{ product.price }}</span> <span class="price-new">{{ product.special }}</span>
{% endif %}
</div>
{% if product.tax %}<div class="price-tax">{{ text_tax }} {{ product.tax }}</div>{% endif %}
{% endif %}
<div class="product-thumb__cart cart {{ product.cart_btn_class }}">
{% if product.show_quantity %}
<div class="qty-switch">
<input type="text" name="quantity" value="{{ product.minimum }}" data-minimum="{{ product.minimum }}" class="qty-switch__input form-control" />
<div>
<i class="qty-switch__btn fa fa-plus btn-default"></i>
<i class="qty-switch__btn fa fa-minus btn-default"></i>
</div>
</div>
{% endif %}
<button type="button" class="product-thumb__add-to-cart add_to_cart btn {{ product.cart_btn_class }}" title="{{ product.cart_btn_text }}" data-pid="{{ product.product_id }}" onclick="cart.add({{ product.product_id }}, this)"><i class="{{ product.cart_btn_icon }}"></i><span>{{ product.cart_btn_text }}</span></button>
<button type="button" class="product-thumb__quick-order quick-order btn {{ product.quick_order is empty ? ' hidden' }}" title="{{ quick_order_title }}" onclick="quick_order('{{ product.product_id }}');"><i class="{{ quick_order_icon }}"></i><span>{{ quick_order_title }}</span></button>
<button type="button" class="product-thumb__wishlist wishlist {{ wishlist_btn_disabled ? ' hidden' }}" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><i class="far fa-heart"></i></button>
<button type="button" class="product-thumb__compare compare {{ compare_btn_disabled ? ' hidden' }}" title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><i class="fas fa-align-right"></i></button>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{{ pagination }}
<div class="pagination-text">{{ results }}</div>
{% else %}
<div class="div-text-empty">{{ text_empty }}</div>
{% endif %}
</div>
{{ content_bottom }}
</div>
{{ column_right }}
<script>uniSelectView.init();</script>
</div>
</div>
{% if products %}
<script>
$(function() {
let showTimer = function() {
$('.product-layout .product-thumb__image').each(function() {
const date = $(this).data('special-end');
if(date) {
$(this).uniTimer({
date :''+date+'',
texts :['{{ text_special_day }}','{{ text_special_hour }}','{{ text_special_min }}','{{ text_special_sec }}']
});
}
});
};
showTimer();
let observer = new MutationObserver(() => {
showTimer();
});
observer.observe($('.products-block')[0], {childList:true});
});
</script>
{% endif %}
<script>
$('#button-search').bind('click', () => {
let url = 'index.php?route=product/search';
const search = $('#content input[name=\'search\']').val(),
category_id = $('#content select[name=\'category_id\']').val(),
sub_category_id = $('#content input[name=\'sub_category\']:checked').val(),
filter_description = $('#content input[name=\'description\']:checked').val();
if (search) url += '&search=' + encodeURIComponent(search);
if (category_id > 0) url += '&category_id=' + encodeURIComponent(category_id);
if (sub_category_id) url += '&sub_category=true';
if (filter_description) url += '&description=true';
location = url;
});
$('#content input[name=\'search\']').bind('keydown', (e) => {
if (e.keyCode == 13) {
$('#button-search').trigger('click');
}
});
$('select[name=\'category_id\']').on('change', function() {
if (this.value == '0') {
$('input[name=\'sub_category\']').prop('disabled', true);
} else {
$('input[name=\'sub_category\']').prop('disabled', false);
}
});
$('select[name=\'category_id\']').trigger('change');
</script>
{{ footer }}