var item = {}, cart = [];
item.id = id;
item.count = count;
cart.push(item);
$("#main-form").on('submit',(function(e){
e.preventDefault();
Main.sendZakaz(this, cart);
return false;
}));
$('.up').click(function(){
id = $(this).attr('id');
count_tovar = $('#count_tovar[data-id="'+id+'"]');
$(count_tovar).text(parseInt($(count_tovar).text())+1);
prices = $('.col_tot');
prices_text = (parseInt($(prices).text())+parseInt($(this).attr('data-price')));
$(prices).text(prices_text);
var item = {}, cart = [];
item.id = id;
item.count = (parseInt($(count_tovar).text()));
item.total = prices_text;
cart.push(item);
return false;
})
$('.down').click(function(){
id = $(this).attr('id');
count_tovar = $('#count_tovar[data-id="'+id+'"]');
if(parseInt($(count_tovar).text()) != 0){
$(count_tovar).text(parseInt($(count_tovar).text())-1);
prices = $('.col_tot');
prices_text = (parseInt($(prices).text())-parseInt($(this).attr('data-price')));
$(prices).text(prices_text);
var item = {}, cart = [];
item.id = id;
item.count = (parseInt($(count_tovar).text()));
item.total = prices_text;
cart.push(item);
return false;
}
return false;
})