@ecomplus/search-engine
Version:
JS lib to handle products search with E-Com Plus stores
28 lines (24 loc) • 680 B
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Hello, world!</title>
</head>
<body>
<h1>Hello, world!</h1>
<div id="app"></div>
<script src="ecom-search.min.js"></script>
<script>
const search = new EcomSearch()
EcomSearch.setWarehouse('MG')
search.fetch()
.then(result => {
document.getElementById('app').innerHTML = '<hr>' +
search.getItems().map(({ name }) => name).join('<br>')
console.log(result)
})
.catch(console.error)
</script>
</body>
</html>