Broadleaf Microservices
  • v1.0.0-latest-prod

Cart Operation Release Notes for 2.2.1-GA

Tip
The 2.x versions are Spring Boot 3 compatible.

Requirements

  • JDK 17 is required for Broadleaf release trains 2.0.0-GA, and beyond.

New Features & Notable Changes

Support Specifying Inventory Locations in Availability Request

Overview

Introduced the ability to specify an inventory location when adding an item (or a list of items) to cart. This allows for grouping items into fulfillment groups that share the same inventory location instead of just the same fulfillment type. When performing inventory availability checks, the system will now only consider the quantity within the specified inventory location for each item, whereas by default, availability is determined based on whether the item is available in any inventory location, without discrimination. Also ensured that the inventory location is included on the SkuInventoryAvailabilityRequest that is sent to the Inventory Service per item.

Note
The original behavior will continue to apply by default if no inventory location is not specified by the user.

Implementation Details

  • Added inventoryLocationRef field to AddItemRequest and SkuInventoryAvailabilityRequest

  • Introduced new Cart internal attribute, SKU_CODES_BY_INVENTORY_LOCATION, to store a mapping of location refs to SKUs using that location

  • Changes to DefaultCartOperationService

    • Introduced protected method addInventoryLocationCartAttribute that sets SKU_CODES_BY_INVENTORY_LOCATION map.

      • Called when creating new Cart Items

    • Modified protected addItemToFulfillmentGroup to group items into FulfillmentGroups by inventory location in addition to fulfillment type.

    • Deprecated existing protected method, createFulfillmentGroupForItems, in favor of a homonymous method that takes in the additional argument String inventoryLocationReference.

Usage

This feature can be leveraged for use cases that require selecting an inventory location (e.g., a store) before or during adding items to the cart. No property is required to enable the feature, requiring only that an inventoryLocationRef is included in the AddItemRequests.

Bug Fixes

  • Fix the issue for proper handling of COD payment added to the cart when a stale cart item is removed

  • Fixed issue where a duplicate key error would be thrown when adding an item to a cart multiple Fulfillment Groups with the same Fulfillment Type.

  • Updated a priceCart call in DefaultFulfillmentOptionRequestService to utilize the Cart Operations Service instead of the Cart Pricing Service.

    • This fixes an issue where pricing was not correctly hitting important flows such as gift calculations.

  • Fixed an issue where gifts could not be removed from the cart if the gift offer had no qualifiers attached to it.

    • This keeps the gift in a state where it continues to have an entry in the internal attributes for OFFER_IDS_TO_IGNORE_MAP, similar to how it works when there are qualifiers attached.

  • Fixed an issue where a merging-type of COMBINE for CartItems would not correctly keep gifts separate when a similar item to the gift is added to the cart.

    • Similar items added to the cart are still combined, but gifts are separated unless another gift of the same type is added.