| Line 68... |
Line 68... |
| 68 |
<?php foreach($results->facets as $facets){ ?>
|
68 |
<?php foreach($results->facets as $facets){ ?>
|
| 69 |
<div class="filter-name"><?php if(isset($facets->displayText) && !empty($facets->displayText)) echo $facets->displayText;?><span>+</span></div>
|
69 |
<div class="filter-name"><?php if(isset($facets->displayText) && !empty($facets->displayText)) echo $facets->displayText;?><span>+</span></div>
|
| 70 |
<div class="filter-options" style="display:none" >
|
70 |
<div class="filter-options" style="display:none" >
|
| 71 |
<?php $i=0;
|
71 |
<?php $i=0;
|
| 72 |
foreach($facets->filterOptions as $filterOptions){ ?>
|
72 |
foreach($facets->filterOptions as $filterOptions){ ?>
|
| 73 |
<div id="<?php echo $filterOptions->value;?>" <?php if(($filterOptions->value == 'Mobile Accessories') || ($filterOptions->value == 'Basic Phones')){ ?> onclick="filterAccess('main')"<?php }else{ ?> onclick="filterAccess('brand')" <?php }?> data-parent="<?php echo $facets->displayText;?>" data-key="<?php echo $filterOptions->key; ?>" data-value="<?php echo $filterOptions->value; ?>"
|
73 |
<div id="<?php echo $filterOptions->value;?>" <?php if(($filterOptions->value == 'Mobile Accessories') || ($filterOptions->value == 'Mobile Phone') || ($filterOptions->value == 'Cameras') || ($filterOptions->value == 'Tablets') || ($filterOptions->value == 'Laptop Accessories') || ($filterOptions->value == 'Smart Watches')){ ?> onclick="filterAccess('main')"<?php }else{ ?> onclick="filterAccess('brand')" <?php }?> data-parent="<?php echo $facets->displayText;?>" data-key="<?php echo $filterOptions->key; ?>" data-value="<?php echo $filterOptions->value; ?>"
|
| 74 |
<?php if($filterOptions->selected == 'true'){
|
74 |
<?php if($filterOptions->selected == 'true'){
|
| 75 |
$selectedFilters[$i] = $filterOptions->value; $i++;?>
|
75 |
$selectedFilters[$i] = $filterOptions->value; $i++;?>
|
| 76 |
class="opt selected" <?php } else{?> class="opt" <?php }?> >
|
76 |
class="opt selected" <?php } else{?> class="opt" <?php }?> >
|
| 77 |
<?php if(isset($filterOptions->nestedOptions) && !empty($filterOptions->nestedOptions)){ ?>
|
77 |
<?php if(isset($filterOptions->nestedOptions) && !empty($filterOptions->nestedOptions)){ ?>
|
| 78 |
+
|
78 |
+
|
| Line 195... |
Line 195... |
| 195 |
}
|
195 |
}
|
| 196 |
}
|
196 |
}
|
| 197 |
}
|
197 |
}
|
| 198 |
|
198 |
|
| 199 |
});
|
199 |
});
|
| 200 |
|
200 |
|
| - |
|
201 |
var ominVal = document.getElementById('minprice').innerHTML;
|
| - |
|
202 |
var omaxVal = document.getElementById('maxprice').innerHTML;
|
| - |
|
203 |
var minVal = document.getElementById('exTO').innerHTML;
|
| - |
|
204 |
var maxVal = document.getElementById('exFR').innerHTML;
|
| 201 |
|
205 |
|
| 202 |
function filterAccess(el){
|
206 |
function filterAccess(el){
|
| 203 |
debugger
|
207 |
debugger;
|
| 204 |
if(event.toElement.className.indexOf('selected') != -1){
|
208 |
if(event.toElement.className.indexOf('selected') != -1){
|
| 205 |
event.toElement.className = event.toElement.className.replace('selected', '');
|
209 |
event.toElement.className = event.toElement.className.replace('selected', '');
|
| 206 |
event.toElement.nextElementSibling.style.display = 'none'
|
210 |
event.toElement.nextElementSibling.style.display = 'none'
|
| 207 |
return false;
|
211 |
return false;
|
| 208 |
}else{
|
212 |
}else{
|
| Line 224... |
Line 228... |
| 224 |
}else{
|
228 |
}else{
|
| 225 |
url1 = window.location.href
|
229 |
url1 = window.location.href
|
| 226 |
url1 = url1.split('&');
|
230 |
url1 = url1.split('&');
|
| 227 |
url1 = url1[0]+'&fq='+event.toElement.getAttribute('data-key')+':'+sp;
|
231 |
url1 = url1[0]+'&fq='+event.toElement.getAttribute('data-key')+':'+sp;
|
| 228 |
}
|
232 |
}
|
| - |
|
233 |
if((window.location.href.indexOf('minPrice') != -1) ){
|
| - |
|
234 |
if((url1.indexOf('minPrice') == -1)){
|
| - |
|
235 |
url1 = url1+'&minPrice='+document.getElementById('exTO').innerHTML+'&maxPrice='+document.getElementById('exFR').innerHTML;
|
| - |
|
236 |
}
|
| - |
|
237 |
}
|
| - |
|
238 |
|
| 229 |
window.location.assign(url1);
|
239 |
window.location.assign(url1);
|
| 230 |
event.stopPropagation();
|
240 |
event.stopPropagation();
|
| 231 |
|
241 |
|
| 232 |
}
|
242 |
}
|
| - |
|
243 |
|
| - |
|
244 |
|
| 233 |
function applyFilter1(){
|
245 |
function applyFilter1(){
|
| - |
|
246 |
|
| - |
|
247 |
var ominVal = document.getElementById('minprice').innerHTML;
|
| - |
|
248 |
var omaxVal = document.getElementById('maxprice').innerHTML;
|
| - |
|
249 |
var minVal = document.getElementById('exTO').innerHTML;
|
| - |
|
250 |
var maxVal = document.getElementById('exFR').innerHTML;
|
| - |
|
251 |
debugger
|
| - |
|
252 |
|
| - |
|
253 |
var url1;
|
| - |
|
254 |
|
| - |
|
255 |
if(window.location.href.indexOf('minPrice') != -1){
|
| - |
|
256 |
if((<?php echo $results->minPrice; ?> != minVal) || (<?php echo $results->maxPrice; ?> !=maxVal)){
|
| - |
|
257 |
url1 = window.location.href.replace(<?php echo $results->minPrice; ?>,document.getElementById('exTO').innerHTML);
|
| - |
|
258 |
url1 = url1.replace(<?php echo $results->maxPrice; ?>,document.getElementById('exFR').innerHTML);
|
| - |
|
259 |
}
|
| - |
|
260 |
}else{
|
| 234 |
var url1 = window.location.href +'&minPrice='+document.getElementById('exTO').innerHTML+'&maxPrice='+document.getElementById('exFR').innerHTML;
|
261 |
url1 = window.location.href+'&minPrice='+document.getElementById('exTO').innerHTML+'&maxPrice='+document.getElementById('exFR').innerHTML;
|
| - |
|
262 |
}
|
| 235 |
window.location.assign(url1);
|
263 |
window.location.assign(url1);
|
| - |
|
264 |
|
| 236 |
}
|
265 |
}
|
| - |
|
266 |
|
| 237 |
</script>
|
267 |
</script>
|
| - |
|
268 |
|
| - |
|
269 |
|