Broadleaf Microservices
  • v1.0.0-latest-prod

Offer Validation Workflow Activity

Overview

This CheckoutWorkflowActivity provides validation that applied Offers, Offer codes, and Campaign codes can still be used before completing a checkout submission. Offers and codes are a means of applying discounts and associating promotions and campaigns to a customer and their order, and their usages can be limited to a certain number of times per order, user, or overall.

Default Implementation Details

CartOfferValidationActivity makes use of the Offer and Campaign providers to validate usages of offers and codes. If an offer or code cannot be used, then a CheckoutWorkflowActivityException is thrown with a failure type of INVALID_OFFER_OR_OFFER_CODE_USAGE, which is then handled by CheckoutWorkflowActivity and can be referenced by the checkout initiator in the CheckoutResponse.

Configuration

By default, CartOfferValidationActivity is not enabled. Thus, validation is only done when the offer or code is applied initially. This was done with an eye toward better user experience during checkout.

To enable it add the following configuration:

broadleaf:
  cartoperation:
    checkout:
      activity:
        validation:
          cart-offer:
            enabled: true