Home > widget-integration > PredictiveBundleService > calculateBundleData

PredictiveBundleService.calculateBundleData() method

Calculates derived bundle state such as selected variants, totals, and discount values.

Override this method to inject shop-specific bundle business rules while keeping the controller rendering flow unchanged.

Signature:

calculateBundleData(bundle: PredictiveBundleData, updateData?: BundleUpdateData, action?: BundleAction): PredictiveBundleData;

Parameters

Parameter

Type

Description

bundle

PredictiveBundleData

Raw bundle payload.

updateData

BundleUpdateData

(Optional) Variant or product selection change data.

action

BundleAction

(Optional) Action that triggered recalculation.

Returns:

PredictiveBundleData

Normalized bundle state ready for rendering.