public function totalDiscount($format = true, $withItemDiscounts = true)
    {
        $total = 0;

        if ($withItemDiscounts) {
            /** @var CartItem $item */
            foreach ((array) $this->cart->items as $item) {
                $total += floatval($item->getDiscount(false));
            }
        }

        foreach ($this->cart->coupons as $coupon) {
            if ($coupon->appliedToCart) {
                $total += $coupon->discount();
            }
        }

        if ($total < 0) {
            $total = $this->subTotal(false);
        }

        return $this->formatMoney($total, null, null, $format);
    }