search-box-category-suggestions
v0.0.6
Published
Adds category suggestions in the search box
Downloads
5
Maintainers
Keywords
Readme
Search Box Category Suggestions
Props
| Name | Type | Description | | :---: | :---: | :---: | | callback-function | string | Name of callback function to be called when category suggestion is clicked | | field | string | Name of the category field | | delimiter | string | The delimiter used in the category field hierarchy | | basePath | [] string | Array of base path for the categories. |
This component adds functionality to the search box by providing category suggestions. It should be placed inside of the <atomic-search-box>
component. The field used needs to be a hierarchical field. The logic for what happens when a suggestion is selected can be placed inside of a script tag in the html document.
<script>
window.selectCategorySuggestion = function () {
console.log('put your select category suggestion function logic here');
}
</script>
<atomic-search-box>
<search-box-category-suggestions field="ec_category" callback-function="selectCategorySuggestion">
</search-box-category-suggestions>
</atomic-search-box>