Interface Config

User provided configuration

Hierarchy

  • Config

Properties

autocompleteComponent?: ComponentType

Preact autocomplete main component

autocompleteMinLength?: number

Minimal input length to render autocomplete

@default: 2

autocompleteQuery?: Partial<SearchQuery>

Default autocomplete query parameters.

categoryComponent?: ComponentType

Category root component

categoryCssSelector?: string

CSS selector for category content rendering

categoryFallback?: ((query) => void)

Type declaration

    • (query): void
    • Enable category fallback when service is unavailable (overwrites global fallback option).

      By default it will redirect to original page by disabling new page. If custom function is provided, it will be called with query object.

      It's important that this path does not have same path as search page.

      Parameters

      Returns void

      Example

      categoryFallback: (query) => {
      location.replace(`/categories/${query.products.categoryId}`)
      }
categoryId?: (() => undefined | string)

Type declaration

    • (): undefined | string
    • returns current category id, now is used for backward compatibility with categoryQuery

      Returns undefined | string

categoryPath?: (() => undefined | string)

Type declaration

    • (): undefined | string
    • returns current category path, now is used for backward compatibility with categoryQuery

      Returns undefined | string

compressUrlParameters: boolean

Indicates if URL parameters should be compressed

Default

false
contentCssSelector?: string

CSS selector for search page rendering.

debounceDelay?: number

Debounce delay for search input

defaultCurrency: string

Merchant's default Currency.

dropdownCssSelector?: string

CSS selector for autocomplete dropdown render. Leave undefined for default use (After input element)

fallback?: boolean

Enabled fallback for serp & category pages when service is unavailable By default it will redirect to original pages by disabling new pages

@default: false

formCssSelector: string

CSS selector for form to unbind it.

formUnbindDelay?: number

Form unbind delay after how long it should delay, default is unbinding without delay ms

historyComponent?: ComponentType

History component

historyEnabled?: boolean

Indicates if history should be enabled

Default

true
historySize?: number

History size

Default

5
inputCssSelector: string

CSS selector for each input element to bind search events like input change and form submit.

isCategoryPage?: (() => boolean)

Type declaration

    • (): boolean
    • Determine if current page is category Example: return location.pathname.includes('category')

      Returns boolean

merchant: string

Merchant ID.

serpComponent?: ComponentType

Preact search page main component.

serpFallback?: ((query) => void)

Type declaration

    • (query): void
    • Enable search fallback when service is unavailable (overwrites global fallback option).

      By default it will redirect to original page by disabling new page. If custom function is provided, it will be called with query object.

      It's important that this path does not have same path as search page.

      Parameters

      Returns void

      Example

      serpFallback: (query) => {
      location.replace(`/search?q=${query.query}`)
      }
serpPath?: string

Search page path, renders in any page if not specified

serpPathRedirect?: boolean

Indicates if search should redirect to search page or just rewrite history

serpQuery?: Partial<SearchQuery>

Default search page query parameters.

serpUrlMapping?: Record<string, string>

Front end URL both ways mapping, to convert URL param values and keep the request keys { query: 'q' - will map query param to appear as q in URL product.filters: 'ff' - will map to ff.0.field.0: 'brand' and so on.. product.size: 'size' - will map to size: 24 }

Methods

  • returns configuration for category request and now is used for backward compatibility Example: return { products: { categoryId: 123456 }}

    Returns Partial<SearchQuery>

Generated using TypeDoc