cart = new Object();
$(document).ready(function() {
$('.cart-add').on('click', add);
function add() {
var id = $(this).attr("data-id");
var description = $(this).attr("data-description");
var photo = $(this).attr("data-photo");
var info = [];
if (cart[id]!=undefined) {
info = cart[id];//
info[0]++;
}
else {info[0]=1;}
info[1]=description;
info[2]=photo;
cart[id] = info;
}
console.log(cart);
}
});