I've got a computed method that allows me to count a total price of my products and discount value and would like to get the value of: total - discount.
cartTotal() {
var total = 0;
var discount = Math.round((0.1 * this.cartTotal) * 100) / 100;
this.cart.items.forEach(function(item) {
total += item.quantity * item.product.price;
});
total -= discount;
return total;
}
Doens't work for me and I get that Maximum call stack size exceeded
error.