Validating Cart Items
PTC Arbortext Content Delivery enables you to check the validity of cart items and serviceability of parts included in the cart by using the validateCartItems() and validateParts() methods in a custom delegate.
By default, the application includes a few validations for cart items in both methods. For more information about the validateCartItems() and validateParts() methods, see the PTC Arbortext Content Delivery Javadoc.
You can create a custom delegate to add your logic to the validateCartItems() and validateParts() methods and validate any custom attributes for cart items. The custom delegate must implement the com.ptc.sc.services.plugins.CommerceDelegate interface. For more information about creating custom delegates, see Creating Custom delegates on the Server.
You can add validations for cart items for the following cases:
Check the availability of an item added to the cart.
Check the quantity of an item in the cart.
Check whether a part item in the cart is serviceable or not.
For example, code for validating cart items that you can include in a custom delegate, see Example Codes for Validating Cart Items.