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) { $("").appendTo(".pagination"); } }).fail(function(){ alert('Произошла ошибка во время загрузки данных.'); }); } $(document).ready(function() { $.address.init(); if ($.address.parameter("usedAttributes") != undefined) { var arr = String($.address.parameter("usedAttributes")).split(","); for (var i = 0; i < arr.length; i++) { if (arr[i]) { var value = String(arr[i]).split(":"); usedAttributes.push(arr[i]); $("#attribute_" + value[1]).addClass("selected"); } } } if ($.address.parameter("page") != undefined) { page = $.address.parameter("page"); } if ($.address.parameter("qpp") != undefined) { qpp = $.address.parameter("qpp"); } if ($.address.parameter("sortType") != undefined) { sortType = $.address.parameter("sortType"); } if ($.address.parameter("view") != undefined) { view = $.address.parameter("view"); if(view == 'cell') { $(".product-filter .cell").removeClass("disabled").addClass("enabled"); $(".product-filter .list").removeClass("enabled").addClass("disabled"); $(".product-filter .list-2").removeClass("enabled").addClass("disabled"); } if(view == 'list') { $(".product-filter .cell").removeClass("enabled").addClass("disabled"); $(".product-filter .list").removeClass("disabled").addClass("enabled"); $(".product-filter .list-2").removeClass("enabled").addClass("disabled"); } if(view == 'list-2') { $(".product-filter .cell").removeClass("enabled").addClass("disabled"); $(".product-filter .list").removeClass("enabled").addClass("disabled"); $(".product-filter .list-2").removeClass("disabled").addClass("enabled"); } } if (usedAttributes.length > 0 || page != 1 || qpp != 20 || sortType != 0) { callGetData(false); } }); function addToCart(product_id, href){ $.ajax({ url: 'index.php?route=checkout/cart/add', type: 'post', data: 'product_id=' + product_id, dataType: 'json', success: function(json) { if (json['error']) { location = json['redirect']; } if (json['success']) { location = "/index.php?route=checkout/cart"; } } }); }
Вид     /     /   
Товаров на странице   из 876      Сортировка 
Показано с 1 по 20 из 876 (всего 44 страниц)
© 2009-2013 Прицел.ру - поставка из США Все права защищены