Home > widget-integration > RecommendationWidgetController > renderBundleWidget

RecommendationWidgetController.renderBundleWidget() method

Renders the bundle widget by processing product variants and initializing interactions.

This method handles the complete bundle widget rendering process: 1. Processes products and selects available variants 2. Calculates initial total price and selection state 3. Renders template with processed data 4. Initializes bundle-specific event handlers

Signature:

renderBundleWidget(container: HTMLElement): Promise<void>;

Parameters

Parameter

Type

Description

container

HTMLElement

The HTML element where the bundle widget will be rendered

Returns:

Promise<void>

Exceptions

{Error} When template rendering fails or model is unavailable

Remarks

The method automatically selects the first available variant for each product and marks products as checked only if they have available variants.

Example

Override to add custom product filtering:

async renderBundleWidget(container) {
  // Custom pre-processing
  const { model } = this.state.value;
  if (model) {
    model.properties.products = this.filterProductsForShop(model.properties.products);
  }

  await super.renderBundleWidget(container);
}