You are here

class CouponValidConstraint in Commerce Cart API 8

Coupon valid reference constraint.

Verifies that coupon applies to the order.

Plugin annotation


@Constraint(
  id = "CouponValid",
  label = @Translation("Coupon valid reference", context = "Validation")
)

Hierarchy

  • class \Drupal\commerce_cart_api\Plugin\Validation\Constraint\CouponValidConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of CouponValidConstraint

File

src/Plugin/Validation/Constraint/CouponValidConstraint.php, line 17

Namespace

Drupal\commerce_cart_api\Plugin\Validation\Constraint
View source
class CouponValidConstraint extends Constraint {

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = 'The coupon %code is not available for this order.';

}

Members

Namesort descending Modifiers Type Description Overrides
CouponValidConstraint::$message public property The default violation message.