Add With No Configuration

Adding a default configuration to the basket is called adding with no configuration. The basket action input parameter is addwithNoConfig along with the offer code to add to the basket. The pricing and validation rules are run on the basket in case of a cache miss scenario and validation checks to ensure the basket is still pristine in case of cache hit scenarios.

The types of basket operations are explained in the following subsections.

Adding to an empty basket means that there are currently no contents or no basket present. A default configuration of the product is added to the basket. Therefore, a basket is created with the default configuration of the offer defined in EPC. The child products having default quantity as 1 or more (considering their ancestors have a default quantity of 1 or more) are added as a line item. Other products with a quantity of 0 are considered child products and are not added.

The following are applied to the content of the basket:

  • Attribute overrides

  • Advance rules of auto-add

  • Auto-remove

  • Modify

  • Qualification rules on a price list entry

  • Tightest match price

  • Matrix-based pricing

  • Attribute configuration rules

  • Cardinality overrides

The response is generated and cached with a unique key formed by considering the user shape, basket contents, and the operation performed.

  • Product: There are two modes in which a product can be added to the basket:

    • Single mode, where only one product is added

    • Multi mode,  where multiple products can be added to the basket in a single transaction.

    The product code provides the cached bundle wrapper or offer details that are currently active and have been cached by the offerDetails batch job. With versioning enabled and time slicing on the offer details, you only get the currently active version of that offer. That version is added to the basket and the validation and pricing rules engine are applied. The basket is cached with the effectivity of that particular time slice of the offer details. The version effectivity of the offer is the effectivity of the basket. After a particular product version ends, the basket is no longer valid. The basket effectivity does not exceed the effectivity of the offer versions.

  • Promotion: Adding a promotion only works in single mode where you can only add one promotion to the basket. The promotion code provides the offer details that are cached during the offer details batch job and time-sliced with the version effectivity of the associated child products. Promotional offer details are added and basket operations are applied.

  • Simple promotions can be added in single mode or multi-mode. Simple promotions have only admin time configuration with limited functionality for adjustments and overrides. When the simple promotion offer code(s) are passed in the input, the system queries the cached response and gets the corresponding promotional wrappers. The promotional wrappers create the XLIs and promotional items, run validation and pricing, and cache the basket.

The Add to an existing basket operation adds the default configuration of the offer to an already created and cached basket that has a cart context key. The cart context key is the parameter passed in the input request URL and using that parameter, the system gets the existing cached basket. If the basket is not found with the cart context key passed, the system throws an error stating that the basket has not been found. The cached basket is fetched from the database and a validation check is performed to determine its condition. These validations occur under the Validate URL parameter, which is defaulted to true, so by default, the system checks for the pristinity of the cached basket before proceeding with the add operation.

  • Product: Adding multiple products in an existing basket follows a similar route of pricing and validation for adding to an empty basket. The cache effectivity is the subset of the existing basket and the individual version time slices that are currently effective. The reference dates passed for the validation and pricing are the current date-time. The cache key processes the bundle structure of the existing basket and offer plus the catalog codes for the new offers that were added or appended. The user shape results in the cart context key.

    For the addition of individual offers, the basket also caches the current date-time at which the root products were added. For example, an operation on the child product or update at the time at which the root product was added becomes the reference time.

  • Promotion: Adding promotions to an existing basket can result in two types of internal operations:

    • Applying a promotion: When the promotional products are already part of the basket and a promotion is added, the promotion and corresponding discounts apply to the basket. With versioning enabled, the effectivity of the basket corresponds to the time slice.

    • Add the promotional product: When the type is add or apply and the child products are not present in the existing basket, then the system creates the child product order line items and applies the promotion. Adding a promotion means adding the promotional products as well, so with versioning enabled the same time-sliced policy applies.

  • Simple promotions can be part of multi-add as well as single add. When adding simple promotions to an existing basket, the run-time behavior of the basket remains the same as that of the v2 promotion. Products are added first and then promotions are applied. For add/update, promotional items are created and promotions added. With versioning enabled, pricing and validation are run with the reference date as the current date-time. Caching follows the same time slice date policy.