Home > widget-integration > FilterService > parseHistoryParams

FilterService.parseHistoryParams() method

Parses URL history parameters and updates filter state.

Extracts filter parameters, sort options, and pagination from URL, updates FilterStore state, and rewrites URL with proper formatting. Handles URL shortening if enabled in settings.

Signature:

parseHistoryParams(): void;

Returns:

void

Remarks

Called during filter initialization to restore filter state from URL. Ensures consistent URL format and state synchronization.

Example

Override to customize URL parameter parsing:

parseHistoryParams() {
  super.parseHistoryParams();
  // Parse custom shop-specific URL parameters
  const customParams = this.parseCustomShopParams();
  this.filterStore.setState({ customParams });
}