Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('body').on('click', '.filter-results-btn', function (e) {
- e.preventDefault();
- var price_from = $('input[name="price_from"]').val();
- var price_to = $('input[name="price_to"]').val();
- var page = $('#page').val();
- var sort = $('#sort').val();
- sort = '&sort='+sort
- var lang = $('#lang_site').val();
- var full_url_page = $('#full_url_page').val();
- var category_id = $('#category_id').val();
- var url ='/'+ lang + '/filter_products/';
- page = '&page='+page;
- var filter = $('.filter__input:checked').serialize();
- var price = '&price_from='+price_from+'&price_to='+price_to;
- filter = filter + price + page + sort;
- history.pushState({}, ' ', '?'+filter);
- $.ajax({
- url: url, // путь к обработчику
- type: 'POST', // метод отправки
- dataType: 'html',
- data: {filter:filter,category_id:category_id,full_url_page:full_url_page},
- success: function (data) {
- $('.all-products-list').html(data);
- },
- error: function (data) {
- console.log(data); // выводим ошибку в консоль
- }
- });
- return false;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement