Home > widget-integration > PredictiveBundleService
PredictiveBundleService class
Provides predictive bundle business logic, pricing calculations, and template access.
Most shop-specific customization should happen by extending this service instead of editing controller flows directly.
Signature:
export declare class PredictiveBundleService
Example
window.boostWidgetIntegration.extend('PredictiveBundleService', (PredictiveBundleService) => {
return class extends PredictiveBundleService {
getWidgetSettings(widgetId) {
const settings = super.getWidgetSettings(widgetId);
return {
...settings,
widgetDesignSettings: {
...settings.widgetDesignSettings,
buttonText: 'Build my bundle',
},
};
}
};
});
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
(constructor)(appService, platformLoader, templateAPI, predictiveBundleAPI, constants) |
Constructs a new instance of the |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
| |||
|
| |||
|
|
Record<string, RecommendationWidget> | ||
|
| |||
|
| |||
|
| |||
|
|
Record<string, RecommendationWidget> |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
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. | ||
|
Formats a monetary value using the current shop currency settings. | ||
|
Proxies predictive bundle loading to the API layer. | ||
|
Merges widget-specific design settings with predictive bundle defaults. | ||
|
Loads the Liquid template used to render a bundle surface. | ||