$(newarray).each(function (index, product) { totalItems += parseInt(product.quantity); totalPrice += ((getFloat(product.cost)+getFloat(pro