Broadleaf Microservices
  • v1.0.0-latest-prod

FixedFulfillmentPricingProvider

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.

As of ShippingServices 1.1.0-GA (part of the Broadleaf 1.8.0-GA release train), this implementation takes in a list of FixedFulfillmentPricingOptions that is defined by the property broadleaf.shipping.service.fixed.ship-tables, rather than reading from a json config file defined by the property broadleaf.shipping.service.fixed.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.fixed.ship-tables property for production environments so as not to use the example configurations provided out-of-box.

Configuration

The config takes a list of FixedFulfillmentPricingOptions. 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

  • daysToShip: The number of days this option is expected to ship.

Sample Fixed Configuration File (classpath:fixed-ship-example.yml)
broadleaf:
  shipping:
    service:
      fixed:
        # Default configuration
        sample-config: true
        active: true
        ship-tables:
          - name: FIXED_STANDARD
            description: Default Standard
            use-flat-rates: true
            days-to-ship: 5
            percentage-per-item: 0.1
            fixed-price-per-group:
              - currency: USD
                amount: USD 5
              - currency: MXN
                amount: MXN 100
            fixed-price-per-item:
              - currency: USD
                amount: USD 4
              - currency: MXN
                amount: MXN 20
          - name: FIXED_PRIORITY
            description: Default Priority
            use-flat-rates: true
            days-to-ship: 3
            percentage-per-item: 0.2
            fixed-price-per-group:
              - currency: USD
                amount: USD 10
            fixed-price-per-item:
              - currency: USD
                amount: USD 1
          - name: FIXED_EXPRESS
            description: Default Express
            use-flat-rates: true
            days-to-ship: 1
            percentage-per-item: 0.3
            fixed-price-per-group:
              - currency: USD
                amount: USD 15
            fixed-price-per-item:
              - currency: USD
                amount: USD 1
      tenant:
        inactive-tenant-id:
          sample-config: true
          # Inactive for a tenant
          active: false
        some-tenant-id:
          sample-config: true
          # Tenant-specific fixed shipping configurations
          active: true
          ship-tables:
            - name: FIXED_STANDARD
              description: Some Tenant Standard
              use-flat-rates: true
              days-to-ship: 5
              percentage-per-item: 0.3
              fixed-price-per-group:
                - currency: USD
                  amount: USD 5
              fixed-price-per-item:
                - currency: USD
                  amount: USD 1
            - name: FIXED_PRIORITY
              description: Some Tenant Priority
              use-flat-rates: true
              days-to-ship: 3
              percentage-per-item: 0.4
              fixed-price-per-group:
                - currency: USD
                  amount: USD 10
              fixed-price-per-item:
                - currency: USD
                  amount: USD 1
            - name: FIXED_EXPRESS
              description: Some Tenant Express
              use-flat-rates: true
              days-to-ship: 1
              percentage-per-item: 0.5
              fixed-price-per-group:
                - currency: USD
                  amount: USD 15
              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 fixed shipping configurations
          active: true
          ship-tables:
            - name: FIXED_STANDARD
              description: Some Application Standard
              use-flat-rates: true
              days-to-ship: 5
              percentage-per-item: 0.1
              fixed-price-per-group:
                - currency: USD
                  amount: USD 5
              fixed-price-per-item:
                - currency: USD
                  amount: USD 1
            - name: FIXED_PRIORITY
              description: Some Application Priority
              use-flat-rates: true
              days-to-ship: 3
              percentage-per-item: 0.2
              fixed-price-per-group:
                - currency: USD
                  amount: USD 10
              fixed-price-per-item:
                - currency: USD
                  amount: USD 1
            - name: FIXED_EXPRESS
              description: Some Application Express
              use-flat-rates: true
              days-to-ship: 1
              percentage-per-item: 0.3
              fixed-price-per-group:
                - currency: USD
                  amount: USD 15
              fixed-price-per-item:
                - currency: USD
                  amount: USD 1