Broadleaf Microservices
  • v1.0.0-latest-prod

VirtualFulfillmentPricingProvider

Table of Contents
Important
This is deprecated in favor of Fulfillment Services. Fulfillment Services will be responsible for all fulfillment pricing calculations (by default) after Release Trains versions 1.8.2-GA+

Overview

Provides simple fixed fulfillment pricing based on a configuration file for virtual fulfillment.

As of ShippingServices 1.1.0-GA (part of the Broadleaf 1.8.0-GA release train), this implementation takes in a list of VirtualFulfillmentPricingOptions that is defined by the property broadleaf.shipping.service.virtual.fulfillment-options, rather than reading from a json config file defined by the property broadleaf.shipping.service.virtual.configPath. The objective of this change is to support discriminated properties based on a given ContextInfo.

Warning
Make sure to update the broadleaf.shipping.service.virtual.fulfillment-options property for production environments so as not to use the example configurations provided out-of-box.

Configuration

The config takes a list of VirtualFulfillmentPricingOption. Each option takes the following properties in addition to the default FulfillmentOption properties:

  • percentagePerItem: A percentage of an item’s subtotal to charge as a fulfillment cost

  • fixedPricePerItem: A set of fixed prices to charge per item, depending on the currency

  • fixedPricePerGroup: A set of fixed prices to charge per fulfillment group, depending on the currency

Sample Virtual Configuration File (classpath:virtual-fulfillment-option-example.yml)
broadleaf:
  shipping:
    service:
      virtual:
        # Default configuration
        sample-config: true
        active: true
        fulfillment-options:
          - name: DOWNLOAD
            description: Default Download
            percentage-per-item: 0
            fixed-price-per-group:
              - currency: USD
                amount: USD 0
            fixed-price-per-item:
              - currency: USD
                amount: USD 0
          - name: EMAIL
            description: Default Email
            percentage-per-item: 0
            fixed-price-per-group:
              - currency: USD
                amount: USD 0
            fixed-price-per-item:
              - currency: USD
                amount: USD 0
          - name: GRANT_ENTITLEMENTS
            description: Default Grant Entitlements
            percentage-per-item: 0
            fixed-price-per-group:
              - currency: USD
                amount: USD 0
            fixed-price-per-item:
              - currency: USD
                amount: USD 0
      tenant:
        inactive-tenant-id:
          sample-config: true
          # Inactive for a tenant
          active: false
        some-tenant-id:
          sample-config: true
          # Tenant-specific virtual shipping configurations
          active: true
          fulfillment-options:
            - name: DOWNLOAD
              description: Some Tenant Download
              percentage-per-item: 0
              fixed-price-per-group:
                - currency: USD
                  amount: USD 0
              fixed-price-per-item:
                - currency: USD
                  amount: USD 0
            - name: EMAIL
              description: Some Tenant Email
              percentage-per-item: 0
              fixed-price-per-group:
                - currency: USD
                  amount: USD 0
              fixed-price-per-item:
                - currency: USD
                  amount: USD 0
            - name: GRANT_ENTITLEMENTS
              description: Some Tenant Grant Entitlements
              percentage-per-item: 00
              fixed-price-per-group:
                - currency: USD
                  amount: USD 2
              fixed-price-per-item:
                - currency: USD
                  amount: USD 1
      application:
        inactive-application-id:
          sample-config: true
          # Inactive for an application
          active: false
        some-application-id:
          sample-config: true
          # Application-specific virtual shipping configurations
          active: true
          fulfillment-options:
            - name: DOWNLOAD
              description: Some Application Download
              percentage-per-item: 0
              fixed-price-per-group:
                - currency: USD
                  amount: USD 2
              fixed-price-per-item:
                - currency: USD
                  amount: USD 0
            - name: EMAIL
              description: Some Application Email
              percentage-per-item: 0
              fixed-price-per-group:
                - currency: USD
                  amount: USD 2
              fixed-price-per-item:
                - currency: USD
                  amount: USD 1
            - name: GRANT_ENTITLEMENTS
              description: Some Application Grant Entitlements
              percentage-per-item: 0
              fixed-price-per-group:
                - currency: USD
                  amount: USD 5
              fixed-price-per-item:
                - currency: USD
                  amount: USD 1