OrderValidatorsTrait

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

View source

Public Methods

MethodDescription
validateAddress()Validates addresses, and also adds prefixed validation errors to order
validateAddressBelongsToOrdersCustomer()Validates address belongs to the orders custome.
validateAddressReuse()Validates that shipping address isn't being set to be the same as billing adress, when billing address is set to be shipping address
validateCouponCode()
validateGatewayId()
validateLineItems()Validates line items, and also adds prefixed validation errors to order
validatePaymentSourceId()

validateAddress()

Validates addresses, and also adds prefixed validation errors to order

View source

Arguments

  • $attribute (string) – The attribute being validated

Signature

public void validateAddress ( $attribute )

validateAddressBelongsToOrdersCustomer()

Validates address belongs to the orders custome.

View source

Arguments

  • $attribute (string) – The attribute being validated

Signature

public void validateAddressBelongsToOrdersCustomer ( $attribute )

validateAddressReuse()

Validates that shipping address isn't being set to be the same as billing adress, when billing address is set to be shipping address

View source

Arguments

  • $attribute (string) – The attribute being validated

Signature

public void validateAddressReuse ( $attribute )

validateCouponCode()

View source

Arguments

  • $attribute

Signature

public void validateCouponCode ( $attribute )

validateGatewayId()

View source

Arguments

Signature

public void validateGatewayId ( $attribute, $params, yii\validators\Validator $validator )

validateLineItems()

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

View source

Arguments

  • $attribute (string) – The attribute being validated

Signature

public void validateLineItems ( $attribute )

validatePaymentSourceId()

View source

Arguments

Signature

public void validatePaymentSourceId ( $attribute, $params, yii\validators\Validator $validator )