BBQ and Fire Pit Accessories
Show filters
Hide filters
', overlayCSS: { backgroundColor: '#fff', cursor: 'default' } });
},
success: function(response) {
if (response.error) {
alert(response.error);
} else {
var current_url = response.current_url;
var current_title = response.current_title.replace(/&/g, '&').replace(/>>/g, '>').replace(/</g, 'M').replace(/"/g, '"');
var current_breadcrumbs = response.current_breadcrumbs;
$('title').html(current_title);
$('.block_type_breadcrumbs').html(current_breadcrumbs);
$('article.webshop-products').html(response.content);
$('#layout_block_filters_block').html(response.filter_block);
$.scrollTo('#products_overview', 0, { axis: 'y' });
toggleFilter();
history.pushState({'goto':current_url}, current_title, current_url);
if (typeof reloadSlider == 'function') { reloadSlider(); }
if (typeof reloadSliderHor == 'function') { reloadSliderHor(); }
if($('#grid-container-products').length === 1){
$('#grid-container-products img').on("load", function() {
$('#grid-container-products').masonry({ itemSelector: '.product', stamp: '.stamp', isFitWidth: true });
});
}
}
}
});
} else {
$('#webshop_products_filter_form_horizontal').submit();
}
return false;
}
function clearFilterHor(filter_id, tag) {
var check = null;
if (filter_id == 'category_filter') {
$('input[name="category_id"]').val('');
$('input[name="category_slug"]').val('');
check = true;
}
if (tag == 'select') {
$('#webshop_products_filter_form_horizontal #'+filter_id).find('option').removeAttr('selected');
} else if (tag == 'checkbox' || tag == 'radio') {
$('#webshop_products_filter_form_horizontal #'+filter_id).find('li input').removeAttr('checked');
if (filter_id == 'brands_filter') {
$('#webshop_products_filter_form_horizontal input[name="less_more[brand]"]').val('more');
}else{
$('#webshop_products_filter_form_horizontal input[name="less_more['+filter_id+']"]').val('more');
}
} else if (filter_id == 'search_field_inputHor' && tag == 'text') {
$('#webshop_products_filter_form_horizontal #'+filter_id).val('');
} else if (filter_id == 'letter' && tag == 'text') {
$('#webshop_products_filter_form_horizontal #'+filter_id).val('');
} else if (tag == 'slider') {
var default_min = $('#webshop_products_filter_form_horizontal #'+filter_id+'_default_minHor').val();
var default_max = $('#webshop_products_filter_form_horizontal #'+filter_id+'_default_maxHor').val();
$('#webshop_products_filter_form_horizontal #'+filter_id).slider('values', 0, default_min);
$('#webshop_products_filter_form_horizontal #'+filter_id).slider('values', 1, default_max);
$('#webshop_products_filter_form_horizontal #'+filter_id+'_minHor').val(default_min);
$('#webshop_products_filter_form_horizontal #'+filter_id+'_maxHor').val(default_max);
$('#webshop_products_filter_form_horizontal #'+filter_id+'_already_selectedHor').val('0');
}
productsFilterHor(check);
}
function reloadSliderHor() {
$('#webshop_products_filter_form_horizontal .slider-range').each(function(){
var slider_id = $(this).attr('id');
var default_min = parseInt($('#webshop_products_filter_form_horizontal #'+slider_id+'_default_minHor').val());
var default_max = parseInt($('#webshop_products_filter_form_horizontal #'+slider_id+'_default_maxHor').val());
var value_min = parseInt($('#webshop_products_filter_form_horizontal #'+slider_id+'_minHor').val());
var value_max = parseInt($('#webshop_products_filter_form_horizontal #'+slider_id+'_maxHor').val());
var already_selected_int = parseInt($('#webshop_products_filter_form_horizontal #'+slider_id+'_already_selectedHor').val());
var already_selected = (already_selected_int == 1) ? true : false;
$('#webshop_products_filter_form_horizontal #'+slider_id).slider({
range: true,
min: default_min,
max: default_max,
step: 1,
values: [value_min, value_max],
slide: function(event, ui){
$('#webshop_products_filter_form_horizontal #'+slider_id+'_minHor').val(ui.values[0]);
$('#webshop_products_filter_form_horizontal #'+slider_id+'_maxHor').val(ui.values[1]);
},
stop: function(event, ui) {
if (already_selected || !((ui.values[0] == default_min) && (ui.values[1] == default_max))) {
productsFilterHor();
}
}
});
$('#webshop_products_filter_form_horizontal #'+slider_id+'_minHor').on('change', function(e) {
e.preventDefault();
var current_min = parseInt(this.value);
var current_max = parseInt($('#webshop_products_filter_form_horizontal #'+slider_id+'_maxHor').val());
$('#webshop_products_filter_form_horizontal #'+slider_id).slider('values', 0, [current_min]);
if (current_max default_max) {
alert('Wrong max value!');
return false;
}
var default_values = (current_min == default_min) && (current_max == default_max);
var products_filter = (already_selected || !default_values);
if (products_filter) {
productsFilterHor();
}
e.stopPropagation();
});
});
}
function toggleFilter(){
$('.toggle-filter-label .show-filter').click(function(e){
$('.horizontal_webshop_products_filter .block-content').addClass('show');
$('.horizontal_webshop_products_filter .block-content').removeClass('hide');
$(this).hide();
$('.toggle-filter-label .hide-filter').show();
});
$('.toggle-filter-label .hide-filter').click(function(e){
$('.horizontal_webshop_products_filter .block-content').addClass('hide');
$('.horizontal_webshop_products_filter .block-content').removeClass('show');
$(this).hide();
$('.toggle-filter-label .show-filter').show();
});
}
1 - 1 of 1 products