LukePOLO\LaraCart\Traits\CouponTrait::checkMinAmount PHP Method

checkMinAmount() public method

Checks the minimum subtotal needed to apply the coupon.
public checkMinAmount ( $minAmount, $throwErrors = true ) : boolean
$minAmount
$throwErrors
return boolean
    public function checkMinAmount($minAmount, $throwErrors = true)
    {
        $laraCart = \App::make(LaraCart::SERVICE);
        if ($laraCart->subTotal(false, false, false) >= $minAmount) {
            return true;
        } else {
            if ($throwErrors) {
                throw new CouponException('You must have at least a total of ' . $laraCart->formatMoney($minAmount));
            } else {
                return false;
            }
        }
    }