Чтобы плагин работал в этой теме дизайна нужно внести изменения в файлы темы дизайна.
Это можно сделать через админ-панель в разделе Витрина - Шаблоны.
.filterext-filter {
display: flex;
gap: 10px;
white-space: nowrap;
align-items: center;
}
.filterext-filter__input {
width: 100%;
}
@media screen and (max-width: 767px) {
.sorting {
flex-wrap: wrap;
gap: 10px;
}
.filterext-filter {
order: -1;
flex: 100%;
}
}
$(function () {
let debounce = function (callback, delay) {
let id = null;
return function () {
const args = arguments;
clearTimeout(id);
id = setTimeout(function () {
callback.apply(null, args);
}, delay);
};
};
let storeSelection = function (input) {
let start = input.selectionStart;
let end = input.selectionEnd;
return function (input) {
$(input).focus();
input.setSelectionRange(start, end);
};
};
let restoreSelection = null;
let onInput = debounce(function (input) {
input.readOnly = true;
$('#products-filters-form').trigger('submit');
restoreSelection = storeSelection(input);
}, 500);
$(document).on('input', '.filterext-filter__input', function () {
onInput(this);
});
$(document).on('filterext_loaded', function () {
if (!restoreSelection) {
return;
}
let $input = $('.filterext-filter__input').first();
restoreSelection($input.get(0));
});
});
<form class="filter__form" method="get" action="{$resetLink}">
и заменить на
<form class="filter__form" method="get" action="{$resetLink}" id="products-filters-form">
<div class="sorting__right">
и заменить на
<div class="filterext-filter">
<span>Поиск по названию или артикулу:</span>
<input class="filterext-filter__input" type="text" name="name_or_sku_code" value="{shopFilterextViewHelper::getLastGetParameter('name_or_sku_code')|escape}" form="products-filters-form">
{if waRequest::isXMLHttpRequest()}
<script>$(document).trigger('filterext_loaded');</script>
{/if}
</div>
<div class="sorting__right">
После этого элемента.