Skip to main content

Example : Sale Badges

Logic

get narrowed results + narrowed search results after submit

JS Code:

function hooks() {
/* enable on load */
FastAutocomplete.registerHook("autocomplete-narrow-by", () => [["Gender","Women"]]);

/* Example: global disable function */
window.disableAutocompleteNarrow = () => {
FastAutocomplete.registerHook("autocomplete-narrow-by", () => null);
}
}

if (window.FastAutocomplete) {
hooks();
} else {
window.addEventListener('fast-autocomplete-ready', function () {
hooks();
});
}