Search widget events
This feature allows you to listen to events dispatched by the search widget when users perform searches, giving you access to search results and product data outside the widget.
1
2
Search result event
const productEvent = new CustomEvent('abtasty_search_result', {
detail: {
resultElement: resultHTMLElement,
index, // index of the element in the hits array
widgetId, // current widget unique ID
}
});window.addEventListener('abtasty_search_result', (event) => {
const { widgetId, index, resultElement } = event.detail;
console.log(widgetId, index, resultElement);
});Last updated
Was this helpful?

