Home > widget-integration > FilterController > renderRecommendationForSearchPage

FilterController.renderRecommendationForSearchPage() method

Renders product recommendations on search result pages. Triggers recommendation widget rendering for search pages with results.

This method is an integration hook that delegates to the dynamicBundle module to render product recommendations based on search context.

Signature:

protected renderRecommendationForSearchPage(): Promise<void>;

Returns:

Promise<void>

Remarks

This method is called automatically during search page initialization and after filter updates. The actual recommendation logic is handled by the dynamicBundle module to keep concerns separated.

Example

Override to customize search page recommendations:

window.boostWidgetIntegration.extend('FilterController', (FilterController) => {
  return class CustomFilterController extends FilterController {
    renderRecommendationForSearchPage() {
      // Only show recommendations for specific search queries
      const searchQuery = this.filterStore.getState('searchQuery');
      if (this.shouldShowRecommendations(searchQuery)) {
        super.renderRecommendationForSearchPage();
      }
    }
  };
});