Home > widget-integration > FilterService > generateFilterDataForRating

FilterService.generateFilterDataForRating() method

Generates selected-filter data for a rating bucket while preserving its original range.

Rating URLs may contain raw bucket ranges such as 4.5:5.49, while the storefront renders the same bucket as 5 stars. The normalized numeric key keeps the selected option in sync with the rendered button and the original value remains as urlValue so an existing range query can still be removed correctly.

Signature:

protected generateFilterDataForRating(key: string, value: any, filterOption: any): any;

Parameters

Parameter

Type

Description

key

string

value

any

filterOption

any

Returns:

any