beforeAutocompleteAsyncFunction
Use this hook to run asynchronous work (for example, external API requests) before Autocomplete continues.
Parameters
This hook doesn’t accept parameters.Returns
This hook doesn’t return a value. Return aPromise to delay Autocomplete until your work completes.
Examples
Delay Autocomplete until an async task completes
Delay Autocomplete until an async task completes
beforeAutocompleteConfigurationOptions
Modifies the global Autocomplete configuration before any plugin executes a .
This hook runs on every keystroke and lets you customize search parameters,
apply a , update analytics tags, or change other search query settings across all Autocomplete sources.
Parameters
Returns
Examples
Add dynamic filters based on query
Add dynamic filters based on query
tags:sale to the search,
if the query includes the word sale.Add rule contexts to product queries
Add rule contexts to product queries
ruleContexts to the product queries in Autocomplete.beforeAutocompletePluginOptions
Customizes individual plugin options during plugin construction.
This hook runs once per plugin at initialization time.
Use the hook to set static defaults like base filters, analytics tags, or custom transform functions.
Parameters
Returns
Examples
Set base filters per plugin
Set base filters per plugin
Customize hits per page per plugin
Customize hits per page per plugin
beforeAutocompletePluginsArray
Manages the plugin array before creating the Autocomplete instance.
This hook runs once at initialization and lets you add and remove plugins, or reorder the plugin array.
Parameters
Returns
Examples
Remove articles and pages plugins
Remove articles and pages plugins
articles and pages plugins.beforeAutocompleteOptions
Use this hook to set or change Autocomplete options, such as the placeholder text.
Parameters
Returns
Examples
Change the placeholder text
Change the placeholder text
beforeAutocompleteFiltersString
Use this hook to add or override filters in the Autocomplete menu.
Parameters
Returns
Examples
Return a custom filter
Return a custom filter
beforeAutocompleteRedirectUrlOptions
Changes the default parameters of the
createRedirectUrlPlugin function.
Parameters
Returns
Examples
Add a custom class to redirect links
Add a custom class to redirect links
beforeAutocompleteMainTemplate
Changes the HTML template that renders the Autocomplete panel.
Use this to render an Autocomplete multi-panel layout.
Parameters
html tagged template function.Returns
Examples
Render a two-column layout
Render a two-column layout
beforeAutocompleteMainProductsTemplate
Renders the product section in the Autocomplete menu.
Parameters
html tagged template function.Returns
Examples
Render the products section
Render the products section
beforeAutocompleteNoResultsTemplate
Renders a template when Autocomplete doesn’t return results.
Parameters
html and state properties.Returns
Examples
Customize the no results panel
Customize the no results panel
beforeAutocompleteHeaderTemplate
Renders a header section at the top of the Autocomplete results panel.
Parameters
html and state properties.Returns
Examples
Customize the results header
Customize the results header
beforeAutocompleteFooterTemplate
Renders a footer section at the bottom of the Autocomplete results panel.
To render a footer, select the Show See All products option in the Autocomplete search options in your store’s admin.
Parameters
html and state properties.Returns
Examples
beforeAutocompleteProductTemplate
Template for rendering each product hit in the Autocomplete results.
If you are using this template, ensure you also call trackSearchAttribution(item) to properly handle events.
Parameters
html, item, and components.Returns
Examples
Customize product items
Customize product items
beforeAutocompleteArticlesTemplate
Template for rendering each article hit in the Autocomplete results.
Parameters
html, item, and components.Returns
Examples
Customize article items
Customize article items
beforeAutocompleteCollectionsTemplate
Template for rendering each collection hit in the Autocomplete results.
Parameters
html, item, and components.Returns
Examples
Customize collection items
Customize collection items
beforeAutocompletePagesTemplate
Template for rendering each pages hit in the Autocomplete results.
Parameters
html, item, and components.Returns
Examples
Customize page items
Customize page items
beforeAutocompleteSuggestionsTemplate
Template for rendering each search suggestion in the Autocomplete menu.
Parameters
html, item, and components.Returns
Examples
Customize suggestions
Customize suggestions
beforeAutocompleteProductTransformResponseHits
Modifies the hits before rendering them in the Autocomplete menu.
For more information, see transformResponse.
Parameters
Returns
Examples
Transform product hits before rendering
Transform product hits before rendering
afterAutocompleteProductClickAction (deprecated)
beforeAutocompleteProductTemplate instead.