Home > widget-integration > FilterController > renderVolumeBundleForSearchPage

FilterController.renderVolumeBundleForSearchPage() method

Renders volume bundle widgets on search result pages. Dynamically imports and initializes volume bundle rendering for search context.

This method uses dynamic import (code splitting) to load the volume-bundle module only when needed, reducing initial bundle size.

Signature:

protected renderVolumeBundleForSearchPage(): Promise<void>;

Returns:

Promise<void>

Remarks

The volume-bundle module is loaded asynchronously via webpack's dynamic import with chunk name 'volume-bundle'. This keeps the main filter bundle lightweight while providing bundle functionality when required.

Example

Override to customize volume bundle rendering:

window.boostWidgetIntegration.extend('FilterController', (FilterController) => {
  return class CustomFilterController extends FilterController {
    renderVolumeBundleForSearchPage() {
      // Only render for specific product types
      const hasEligibleProducts = this.checkForBundleEligibleProducts();
      if (hasEligibleProducts) {
        super.renderVolumeBundleForSearchPage();
      }
    }
  };
});