Click or drag to resize
ShoppingCartItemValidator Class
Class representing validator used for validation of individual shopping cart items.
Inheritance Hierarchy
SystemObject
  CMS.EcommerceShoppingCartItemValidator

Namespace: CMS.Ecommerce
Assembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 12.0.0
Syntax
C#
public class ShoppingCartItemValidator : IValidator

The ShoppingCartItemValidator type exposes the following members.

Constructors
  NameDescription
Public methodShoppingCartItemValidator
Initializes a new instance of the ShoppingCartItemValidator class for given item.
Top
Properties
  NameDescription
Public propertyErrors
Gets an enumeration of validation errors associated with this validator. An empty enumeration is returned if validation succeeded.
Public propertyIsValid
Gets a value indicating whether validation succeeded.
Public propertyItem
Gets shopping cart this validator was initialized for.
Top
Methods
  NameDescription
Public methodValidate
Validates individual shopping cart item. The following conditions must hold true for each item in cart for validation to pass: 1) All shopping cart items are enabled 2) Max units in one order are not exceeded 3) There is enough units in the inventory 4) Customer is registered, if there is a membership type product in the cart 5) Product validity is valid, if there is a membership or e-product type product in the cart.
Protected methodValidateCustomerMembership
Validates that customer is either a member or membership is not required.
Protected methodValidateMaxCartUnits
Validates that cart does not contain more items than allowed.
Protected methodValidateMinCartUnits
Validates that cart contains at least required amount of units.
Protected methodValidateSKUIsEnabled
Validates that SKU is enabled and not expired.
Protected methodValidateUnitsInStock
Validates that cart does not contain more items than are currently in stock.
Top
Extension Methods
  NameDescription
Public Extension MethodContainsTValidatorError
Returns a value indicating whether a validation error of type TValidatorError is in Errors.
(Defined by IValidatorExtensions.)
Public Extension MethodFirstErrorType
Returns Type of the first validation error in Errors.
(Defined by IValidatorExtensions.)
Public Extension MethodGetErrorMessages
Returns collection of localized error messages that occurred during validation.
(Defined by IValidatorExtensions.)
Top
See Also