Enhancing Commerce Functional Capabilities

Managing Order, Cart, and Checkout Updates

Objective

After completing this lesson, you will be able to describe order, cart, and checkout enhancements, including fiscal ID capture, external calculation delegation, promotion engine optimization, and concurrency fixes

Fiscal ID Capture and Validation

A new fiscal ID field is available during checkout for capturing customer fiscal identification numbers (NIF, VAT number, etc.). Validation is performed against country-specific rules via a configurable validator. Enable per-store via the store configuration and wire the validator bean for target countries.

Fiscal ID Capture and Validation

External Calculation SPI

A new SPI delegates cart and checkout calculations to external systems via REST. The SPI supports pricing, tax, and promotion delegation, enabling integration with custom calculation engines even without overriding internal Spring beans.

External Calculation SPI

Performance Improvement for Quotes (B2C)

Quote validation during cart operations can be skipped for B2C workflows where quotes are not used. Set the toggle.skipCartQuoteValidation.enabled to true to bypass this check and reduce cart operation latency.

Performance Improvement for Quotes

DRL Optimization for Multi-Container Promotion Conditions

The Promotion Engine now supports two compile-time DRL (Drools Rule Language) optimizations that reduce memory consumption when promotion rules contain multiple CONTAINER conditions joined by AND. Each optimization is controlled by an independent feature toggle. In large catalogues with many concurrent promotions, these optimizations lower GC pressure and improve promotion evaluation throughput.

Enable the feature toggles in a staging environment and run your full promotion test suite before activating in production. Monitor heap usage and promotion evaluation latency before and after. If your rule set does not use multi-container AND patterns, these optimizations will have no effect.

DRL Optimization for Multi-Container Promotion Conditions

Add to Cart Concurrency Fix

The $0 total price concurrency bug when adding the same product to the cart simultaneously has been fixed using optimistic locking. A new feature toggle enables the fix; enable it to resolve pricing inconsistencies in high-concurrency cart scenarios.

Resolution of Add to Cart Concurrency Issue

Lesson Summary

  • A new fiscal ID field enables capture and country-specific validation of fiscal identification numbers at checkout.
  • The External Calculation SPI delegates pricing, tax, and promotion calculations to external systems via REST.
  • B2C cart operation latency can be reduced by disabling quote validation when the feature is not in use.
  • Two compile-time DRL optimizations reduce memory consumption for promotion rules with multiple CONTAINER AND conditions.
  • An optimistic locking fix resolves the $0 total price concurrency bug during simultaneous add-to-cart operations.