Add custom plugin to Autocomplete
Add custom plugin to the Autocomplete search in your Shopify app.
The autocomplete menu shows products, collections, articles, and search suggestions from your Shopify store, and updates the results as users type.
You can customize the autocomplete menu by creating a custom plugin. This helps in these cases:
-
In addition to showing all matching products or articles, you want to show a subset of data differently. For example, you want to show all on-sale products in a separate list, or only show help articles.
-
You want to search into data from sources other than Algolia in your autocomplete menu.
You can add a custom plugin using the beforeAutocompleteOptions
hook.
Example of sale items
This example shows how to display on-sale products in a separate list (in addition to all other results).
You can achieve this by creating a source that searches into your product index, and applies a filter to only include items where the named_tags.onSale
attribute is true.
Was this page helpful?