OrderValidatorsTrait

Type
Trait
Namespace
craft\commerce\base
Implemented by
craft\commerce\elements\Order

View source

# Public Methods

Method Description
validateAddress() Validates addresses, and also adds prefixed validation errors to order
validateAddressBelongsToOrdersCustomer() Validates that an address belongs to the order‘s customer.
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

Arguments

  • $attribute (string) – The attribute being validated

# validateAddressBelongsToOrdersCustomer()

Validates that an address belongs to the order‘s customer.

View source

Arguments

  • $attribute (string) – The attribute being validated

# 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

Arguments

  • $attribute (string) – The attribute being validated

# validateCouponCode()

View source

Arguments

  • $attribute

# validateGatewayId()

View source

Arguments

# validateLineItems()

Validates line items, and also adds prefixed validation errors to order

View source

Arguments

  • $attribute (string) – The attribute being validated

# validatePaymentCurrency()

View source

Arguments

# validatePaymentSourceId()

View source

Arguments