Добрый день.
Нужно прописать правильный селектор и javascript код в настройки фильтра
В поле Content selector (in JavaScript): .product-grid
В поле JavaScript custom code:
MegaFilter.prototype.beforeRequest = function() {
var self = this;
};
MegaFilter.prototype.beforeRender = function( htmlResponse, htmlContent, json ) {
var self = this;
};
MegaFilter.prototype.afterRender = function( htmlResponse, htmlContent, json ) {
var self = this;
// What a shame bootstrap does not take into account dynamically loaded columns
cols = $('#column-right, #column-left').length;
if (cols == 2) {
$('#content .product-grid .cols').attr('class', 'col-lg-6 col-md-6 col-sm-12 col-xs-12');
} else if (cols == 1) {
$('#content .product-grid .cols').attr('class', 'col-lg-4 col-md-4 col-sm-6 col-xs-12');
} else {
$('#content .product-grid .cols').attr('class', 'col-lg-3 col-md-3 col-sm-6 col-xs-12');
}
cols1 = $('#column-right, #column-left').length;
if (cols1 == 2) {
$('#content .product-grid > div:nth-child(2n+2)').after('<div class="clearfix visible-md visible-sm"></div>');
} else if (cols1 == 1) {
$('#content .product-grid > div:nth-child(3n+3)').after('<div class="clearfix visible-lg"></div>');
} else {
$('#content .product-grid > div:nth-child(4n+4)').after('<div class="clearfix"></div>');
}
};