Here is a list of functions available in the window of the page where the AS layer is installed.
Function that allows you to set a search with a keyword, filters, and page.
you can call this function even if the search layer is not visible in order to prepopulate the listing.
"The filters have the filter name in the 'key' field, while the value is placed in the 'value' field. By default, strings are always used, except for price, which requires an array to be inserted.
example:
window.ASSetSearch('oven',[{
key:'categories',
value:'Washing machines'
},{
key:'sellingPrice',
value:[398,873.9]
}],3)
Here is a list of events generated by the library that can be intercepted by attaching a listener to a specific component.
var websiteSearchBar= document.getElementById('accelasearch-bar-container-container');
websiteSearchBar.addEventListener('EVENT_NAME',(evt)=>{console.log(evt.detail);})
document.body.addEventListener('EVENT_NAME',(evt)=>{console.log(evt.detail);})
as-search-event
#accelasearch-bar-container-container
{
"searchWord": "oven",
"page":2,
"filters": [
{
"key": "brand",
"value": "Electrolux"
},
{
"key": "sellingPrice",
"value": [
381.9,
1369.9
]
}
]
}
as-loaded-layer
document.body
as-open-layer
document.body
as-close-layer
document.body
as-dynamic-showcase-click
document.body