function getRequestTypeIndex(e){const t=e.get(“requestType”);return t?”ConceptSearch”===t?1:”ImageSearch”===t?2:0:0}document.addEventListener(“DOMContentLoaded”,(function(){let e=getRequestTypeIndex(new URL(document.location).searchParams)||0;function t(t){if(t.preventDefault(),”keypress”===t.type&&13===t.which||”click”===t.type){let t=parseInt(this.dataset.tabIndex);t!==e&&document.querySelectorAll(“.smartsearchdemo__container .tab-container”).forEach((function(n){if(parseInt(n.dataset.tabIndex)===t)return document.querySelectorAll(“.tab-container”).forEach((function(e){e.style.display=”none”})),n.style.display=”block”,void(e=parseInt(n.dataset.tabIndex))}))}}document.querySelectorAll(“.tab-container”).forEach((function(t){parseInt(t.dataset.tabIndex)===e?t.style.display=”block”:t.style.display=”none”})),document.querySelectorAll(“.tab-switcher”).forEach((function(e){e.addEventListener(“click”,t),e.addEventListener(“keypress”,t)}))}));
addEventListener(‘hawksearch:loaded’, () => {
// Force the query to be included in the first search
addEventListener(‘hawksearch:before-search-executed’, (event) => {
event.detail.Query = “record_type.keyword: product”;
});
HawkSearch.init({
clientId: “86758207c737498eac921785df2876ae”,
components: {
‘search-field’: {
strings: {
placeholder: ‘Search by Keyword’
}
},
‘conceptsearch-field’: {
strings: {
placeholder: ‘Search by a Concept’
}
},
‘unifiedsearch-field’: {
strings: {
placeholder: [“Describe what you are looking for…”,”What do I need for a camp kitchen?”,”Waterproof hiking shoes”, “Warm skiing kit”]
}
},
‘imagesearch-field’: {
strings: {
placeholder: ‘Describe an image’
}
},
‘visualsearch-field’: {
template: ‘visualsearch-field__template’,
strings: {
dragImageMessage: ‘Search By Image’,
dropImageMessage: ‘Drop an image here’
}
},
‘search-results-item’: {
template: ‘search-results-item__template’
}
},
search: {
url: window.location.pathname,
endpointUrl: “http://127.0.0.1:3000”,
//endpointUrl: “https://searchapi-dev.hawksearch.net”,
itemTypes: {
default: “product”
}
},
urlPrefixes: {
assets: “https://dev.hawksearch.net”,
content: “https://preview-dev.hawksearch.net/grizzlyindustrial”,
},
css: {
customStyles: ‘custom-styles__template’
},
debug: true
});
});
<!– CUSTOM TEMPLATE TO MODIFY THE VISUALS OF COMPONENT –>
{{strings.dragImageMessage}}
{{strings.dropImageMessage}}
<!– CUSTOM TEMPLATE TO MODIFY THE VISUALS OF COMPONENT –>
{{#if pinned}}
{{/if}}
{{#if (lt salePrice price)}}
{{strings.sale}}
{{/if}}
{{#if rating}}
{{/if}}
{{#unless (eq price undefined)}}
{{#if (lt salePrice price)}}
{{currency price}}
{{currency salePrice}}
{{else}}
{{currency price}}
{{/if}}
{{/unless}}