-
Notifications
You must be signed in to change notification settings - Fork 1
/
autosuggest.json
executable file
·77 lines (75 loc) · 2.86 KB
/
autosuggest.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
version: 'io',
platform: "io",
siteName: UnbxdSiteName,
APIKey: UnbxdApiKey,
minChars: 1,
maxSuggestion: 5,
delay: 100,
loadingClass: 'unbxd-as-loading',
preferInputWidthMainContent: true,
mainWidth: 0,
sideWidth: 475,
zIndex: 1000,
position: 'absolute',
template: '2column',
mainTpl: ['inFields', 'promotedSuggestions', 'keywordSuggestions', 'topQueries'],
sideTpl: ['popularProducts'],
sideContentOn: 'left',
showCarts: false,
cartType: 'separate',
onSimpleEnter: function onSimpleEnter() {
this.input.form.submit();
},
onItemSelect: function onItemSelect(data,original) {
if (data.type === 'IN_FIELD') {
if (data.filtername) {
window.location = this.input.form.action + '?q=' + encodeURIComponent(data.value) + '&filter=' + data.filtername + ':' + encodeURIComponent('"' + data.filtervalue + '"');
} else {
this.input.form.submit();
}
} else if (data.type === 'POPULAR_PRODUCTS') {
window.location = original.productUrl;
} else {
this.input.form.submit();
}
},
inFields: {
count: 3,
fields: {
category: 2,
brand: 1
},
header: '',
tpl: ''
},
topQueries: {
count: 2,
header: 'SUGGESTIONS',
tpl: ''
},
"promotedSuggestions": {
"count": 5,
"header": ''
},
keywordSuggestions: {
count: 2,
header: '',
tpl: ''
},
popularProducts: {
count: 6,
fields: ['title', 'doctype', 'autosuggest', 'price', 'imageUrl', 'productUrl'],
name: true,
nameFunctionOrKey: "title",
price: true,
priceFunctionOrKey: 'price',
image: true,
imageUrlOrFunction: 'imageUrl',
currency: '$',
header: 'POPULAR PRODUCTS',
tpl: ''
},
filtered: true,
resultsContainerSelector: '#search_bar_container'
};