0){ data['usedAttributes'] = usedAttributes.toString(); } $.ajax({ url: "/index.php?route=module/filter/getdata", type: "POST", dataType: "json", data: data }).done(function(data) { if (data.products) { $(".products-content").empty(); $(".total .results").empty(); $(".product-total").empty(); if (view == "cell"){ $("#productTemplateCell").tmpl(data.products).appendTo(".products-content"); } if (view == 'list') { $("#productTemplateList").tmpl(data.products).appendTo(".products-content"); } if (view == 'list-2') { $("#productTemplateList2").tmpl(data.products).appendTo(".products-content"); } } if (data.attributes) { $("a.attributes").each(function() { // var value = parseInt($(this).attr('value')); var value = parseInt(this.id.split('_')[1]); if (data.attributes[value]) { $("#attribute_qty_" + value).text(data.attributes[value]); $(this).removeClass("empty"); } else { $("#attribute_qty_" + value).text("0"); $(this).addClass("empty"); } }); } if (typeof(data.navigation.pages) == 'object') { $(".total .results").html("Показано " + data.navigation.range + " из " + data.navigation.total + " (всего " + data.navigation.last + " страниц)"); $(".product-total").html(data.navigation.total); } $(".pagination").html(''); if (typeof(data.navigation.pages) == 'object' && data.navigation.pages.length > 1) { $("