1<script type="text/javascript">
2
3klevu({
4 theme: {
5 setTemplates: {
6 filtersCollapsedHidden: {
7 scope: "landing,catnav",
8 selector: "#klevuLandingTemplateFiltersCollapsed",
9 name: "filters"
10 }
11 },
12 },
13});
14
15klevu.afterTemplateRender("landing,catnav", function(data, scope) {
16 var target = klevu.getSetting(
17 scope.kScope.settings,
18 "settings.search.searchBoxTarget"
19 );
20 klevu.each(klevu.dom.find("#kuFilterOpener", target), function (
21 key,
22 value
23 ) {
24 klevu.event.attach(value, "click", function (event) {
25 document
26 .getElementsByTagName("body")[0]
27 .classList.toggle("filter_opened");
28 });
29 });
30});
31
32</script>
33
34<style>
35
37.kuFilters {
38 display: block;
39}
40#kuFilterOpener {
41 display: none;
42}
43@media (max-width: 768px) {
44 .kuFilters {
45 display: none;
46 }
47 .filter_opened .kuFilters {
48 display: block;
49 }
50 body .kuSearchResultsPageContainer [ku-container][data-container-id="ku_landing_main_content_left"] {
51 position: relative;
52 max-width: initial;
53 width: 100%;
54 min-height: 42px;
55 display: block;
56 }
57 #kuFilterOpener {
58 display: block;
59 width: 80%;
60 height: 32px;
61 margin: auto;
62 }
63}
64</style>
65
66
67<script type="template/klevu" id="klevuLandingTemplateFiltersCollapsed">
68 <% if(data.query[dataLocal].filters.length > 0 ) { %>
69 <button id="kuFilterOpener">
70 <svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
71 <defs>
72 <image width="128" height="128" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABHNCSVQICAgIfAhkiAAAA9pJREFUeJzt3c1R20AYxvEnH/foyC1KBZAKonRAB7iD0AHuIKQCnAoMFSBOOUIqQKkAuQJyWHmGMbtCkl+vvv6/mR0YGUuvvavdlex9kQAAAAAAAAAAAAAAAABgrBJJPyStJT3vlHX1WNJbdDioC0lPel3xu+Wp+ltMRCL/Gf9WWYveYBK6VP7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sBlT8hidxlSdMxn25/olK5W5S7PcL2/vWir8AAAAAAAAAAAAAAAAAAYHz+Ay8t1mZnuutoAAAAAElFTkSuQmCC" id="img_1" />
73 </defs>
74 <g>
75 <use xlink:href="#img_1" fill="#FFFFFF" stroke="none" transform="scale(0.109375 0.109375)" />
76 </g>
77 </svg>
78 Filters
79 </button>
80 <div class="kuFilters" role="navigation" data-position="left" aria-label="Product Filters" tabindex="0">
81
82 <h3 class="kuFiltersTitleHeading"><%=helper.translate("Narrow by")%></h3>
83 <% helper.each(data.query[dataLocal].filters,function(key,filter){ %>
84 <% if(filter.type == "OPTIONS"){ %>
85 <div class="kuFilterBox klevuFilter <%=(filter.multiselect)?'kuMulticheck':''%>" data-filter="<%=filter.key%>" <% if(filter.multiselect){ %> data-singleselect="false" <% } else { %> data-singleselect="true"<% } %>>
86 <div class="kuFilterHead <%=(filter.isCollapsed) ? 'kuExpand' : 'kuCollapse'%>">
87 <% var filter_label = (filter.label=="klevu_price") ? "price" : filter.label; %>
88 <%=helper.translate(filter_label)%>
89 </div>
90 <div data-optionCount="<%= filter.options.length %>" class="kuFilterNames <%= (filter.options.length <= 5 ) ? 'kuFilterShowAll': '' %> <%=(filter.isCollapsed) ? 'kuFilterCollapse' : ''%>">
91 <ul>
92 <% helper.each(filter.options,function(key,filterOption){ %>
93 <li <% if(filterOption.selected ==true) { %> class="kuSelected"<% } %>>
94 <a
95 target="_self"
96 href="#"
97 title="<%=helper.escapeHTML(filterOption.name)%>"
98 class="klevuFilterOption<% if(filterOption.selected ==true) { %> klevuFilterOptionActive<% } %>"
99 data-value="<%=helper.escapeHTML(filterOption.value)%>"
100 >
101 <span class="kuFilterIcon"></span>
102 <span class="kufacet-text"><%=filterOption.name%></span>
103 <% if(filterOption.selected ==true) { %>
104 <span class="kuFilterCancel">X</span>
105 <% } else { %>
106 <span class="kuFilterTotal"><%=filterOption.count%></span>
107 <% } %>
108 </a>
109 </li>
110
111 <% }); %>
112 </ul>
113 <% if(filter.options.length > 5 ) { %>
114 <div class="kuShowOpt" tabindex="-1">
115 <span class="kuFilterDot"></span><span class="kuFilterDot"></span><span class="kuFilterDot"></span>
116 </div>
117 <% } %>
118 </div>
119 </div>
120 <% } else if(filter.type == "SLIDER") { %>
121 <div class="kuFilterBox klevuFilter" data-filter="<%=filter.key%>">
122 <div class="kuFilterHead <%=(filter.isCollapsed) ? 'kuExpand' : 'kuCollapse'%>">
123 <% var filter_label = (filter.label=="klevu_price") ? "price" : filter.label; %>
124 <%=helper.translate(filter_label)%>
125 </div>
126 <div class="kuFilterNames sliderFilterNames <%=(filter.isCollapsed) ? 'kuFilterCollapse' : ''%>">
127 <div class="kuPriceSlider klevuSliderFilter" data-query = "<%=dataLocal%>">
128 <div data-querykey = "<%=dataLocal%>" class="noUi-target noUi-ltr noUi-horizontal noUi-background kuSliderFilter kuPriceRangeSliderFilter<%=dataLocal%>"></div>
129 </div>
130 </div>
131 </div>
132 <% } else { %>
133 <!-- Other Facets -->
134 <% } %>
135 <% }); %>
136
137 <!-- <div class="kuFiltersFooter">
138 <a target="_self" href="javascript:void(0)" class="kuBtn kuFacetsSlideOut kuMobileFilterCloseBtn" role="button" tabindex="0" area-label=""><%=helper.translate("Close")%></a>
139 </div> -->
140
141
142 </div>
143 <% } %>
144</script>
145