LukePOLO\LaraCart\Coupons\Fixed::discount PHP Method

discount() public method

Gets the discount amount.
public discount ( $throwErrors = false ) : string
$throwErrors boolean this allows us to capture errors in our code if we wish, that way we can spit out why the coupon has failed
return string
    public function discount($throwErrors = false)
    {
        $total = app(LaraCart::SERVICE)->subTotal(false) - $this->value;
        if ($total < 0) {
            return 0;
        }
        return $this->value;
    }