ItemPriceRange_Filter Widget
The ItemPriceRange_Filter widget displays a price-range slider for the current item search or category. When a shopper changes the slider, the widget refreshes Items_TileListing with price filters.
Add the widget to a page
Use this widget on the same page as Items_TileListing. It requires the GetSearchParameters and SetupItemsToDisplay functions that Items_TileListing provides.
<Control src="LoadWidgetControl.ascx"
FileLocation="ItemPriceRange_Filter.html"
Options="priceBasis: 'List',
titleText: 'Price Range',
rangeBarColor: '#999'" />
How the price filter affects the item listing
The widget first requests the lowest and highest prices for the current category and child-category scope. It displays a range slider only when the returned low and high prices differ.
When the shopper finishes moving the slider, the widget:
- Creates
LowPrice<priceBasis>andHighPrice<priceBasis>filter values. - Includes active characteristic filters when ItemCharacteristics_Filter is present.
- Sends the filters through the search operation supplied by Items_TileListing.
- Calls
SetupItemsToDisplayto replace the items in the main listing.
The price filter does not provide its own item listing. Items_TileListing must be present for the slider to load and refresh results.
Widget options
| Option | Default | Valid values or format | Effect |
|---|---|---|---|
priceBasisString | 'List' | Value accepted by the price-range and item-search operations | Determines the price basis sent when retrieving the range and constructing the low- and high-price filters. |
titleTextString | 'Price Range' | Text | Sets the filter accordion title. |
rangeBarColorString | '#999' | CSS color value | Sets the slider’s selected-range color. |
sliderStepNumber | Calculated from the returned price range | Number | The source calculates the slider step from the price range. When this option is supplied, the current implementation still uses the calculated value rather than the supplied numeric value. |
Interaction with characteristic filters
When ItemCharacteristics_Filter is present, the price filter calls its GetActiveFilters function before adding its price filters. This preserves selected characteristic filters when the shopper changes the price range.
Validate the widget
- Place ItemPriceRange_Filter and Items_TileListing on the same page.
- Open a category with items at different prices and confirm the price-range slider appears.
- Change the slider range and confirm the main item listing refreshes with matching items.
- When ItemCharacteristics_Filter is also present, select a characteristic and then change the price range. Confirm both filters remain applied.