OrderValidatorsTrait
- Type
- Trait
- Namespace
- craft\commerce\elements\traits
- Implemented by
- craft\commerce\elements\Order
OrderValidatorsTrait implements the methods used in Order validation.
View source (opens new window)
# Public Methods
Method | Description |
---|---|
validateAddress() | Validates addresses, and also adds prefixed validation errors to order |
validateAddressReuse() | Validates that shipping address isn't being set to be the same as billing address, when billing address is set to be shipping address |
validateCouponCode() | |
validateGatewayId() | |
validateLineItems() | Validates line items, and also adds prefixed validation errors to order |
validatePaymentCurrency() | |
validatePaymentSourceId() |
# validateAddress()
Validates addresses, and also adds prefixed validation errors to order
View source (opens new window)
Arguments
$attribute
(string (opens new window)) – The attribute being validated
Throws
# validateAddressReuse()
Validates that shipping address isn't being set to be the same as billing address, when billing address is set to be shipping address
View source (opens new window)
Arguments
$attribute
(string (opens new window)) – The attribute being validated
# validateCouponCode()
View source (opens new window)
Arguments
$attribute
Throws
# validateGatewayId()
View source (opens new window)
Arguments
$attribute
(string (opens new window))$params
$validator
(yii\validators\Validator (opens new window))
# validateLineItems()
Validates line items, and also adds prefixed validation errors to order
View source (opens new window)
# validatePaymentCurrency()
View source (opens new window)
Arguments
$attribute
(string (opens new window))$params
$validator
(yii\validators\Validator (opens new window))
# validatePaymentSourceId()
View source (opens new window)
Arguments
$attribute
(string (opens new window))$params
$validator
(yii\validators\Validator (opens new window))
← OrderNoticesTrait Tax →