| Line 51... |
Line 51... |
| 51 |
var s ="";
|
51 |
var s ="";
|
| 52 |
s = encodeURIComponent($(this).val().trim());
|
52 |
s = encodeURIComponent($(this).val().trim());
|
| 53 |
if(s.length > 0 && $('#searchforbrand').val()!= "") {
|
53 |
if(s.length > 0 && $('#searchforbrand').val()!= "") {
|
| 54 |
if(!statepushed) {
|
54 |
if(!statepushed) {
|
| 55 |
if (window.history && window.history.pushState) {
|
55 |
if (window.history && window.history.pushState) {
|
| 56 |
window.history.pushState('forward', null, './6');
|
56 |
window.history.pushState('forward', null, window.location);
|
| 57 |
statepushed = true;
|
57 |
statepushed = true;
|
| 58 |
}
|
58 |
}
|
| 59 |
}
|
59 |
}
|
| 60 |
|
60 |
|
| 61 |
if ($('#searchforbrand').val) {
|
61 |
if ($('#searchforbrand').val) {
|
| 62 |
typingTimer = setTimeout(function doneTyping(){
|
62 |
typingTimer = setTimeout(function doneTyping(){
|
| 63 |
$("#searchloader").removeClass('hidden');
|
63 |
$("#searchloader").removeClass('hidden');
|
| 64 |
$.ajax({
|
64 |
$.ajax({
|
| 65 |
method: "GET",
|
65 |
method: "GET",
|
| 66 |
url: "<?php echo $base_url;?>categories/getdealsforsearchterm/"+s,
|
66 |
url: "<?php echo $base_url;?>categories/getdealsforsearchterm/"+s + "?subcategories="+getJsonFromUrl()["subcategories"],
|
| 67 |
},'json')
|
67 |
},'json')
|
| 68 |
.done(function(msg){
|
68 |
.done(function(msg){
|
| 69 |
if( c != typingTimer) {
|
69 |
if( c != typingTimer) {
|
| 70 |
$("#searchloader").addClass('hidden');
|
70 |
$("#searchloader").addClass('hidden');
|
| 71 |
return;
|
71 |
return;
|
| Line 217... |
Line 217... |
| 217 |
<div id= "moreitem">
|
217 |
<div id= "moreitem">
|
| 218 |
<a href="<?php echo $_SERVER['HTTP_REFERER'];?>"><span style="padding:3px" class="glyphicon glyphicon-arrow-left"></span>Showing <?php echo $searchfor;?> items</a>
|
218 |
<a href="<?php echo $_SERVER['HTTP_REFERER'];?>"><span style="padding:3px" class="glyphicon glyphicon-arrow-left"></span>Showing <?php echo $searchfor;?> items</a>
|
| 219 |
</div>
|
219 |
</div>
|
| 220 |
<?php endif;?>
|
220 |
<?php endif;?>
|
| 221 |
|
221 |
|
| 222 |
<?php if($id==6 && isset($subcategorieschosen) && array_key_exists($_COOKIE['subcategorieschosen'], $searchableSubCategories)):?>
|
222 |
<?php if($id==6 && $subcategories && array_key_exists($subcategories, $searchableSubCategories)):?>
|
| 223 |
<div id= "moreitem">
|
223 |
<div id= "moreitem">
|
| 224 |
<a onclick="clearFilters()" href="<?php echo $_SERVER['HTTP_REFERER'];?>"><span style="padding:3px" class="glyphicon glyphicon-arrow-left"></span>Showing <?php echo $searchableSubCategories[$_COOKIE['subcategorieschosen']];?></a>
|
224 |
<a onclick="clearFilters()" href="<?php echo $_SERVER['HTTP_REFERER'];?>"><span style="padding:3px" class="glyphicon glyphicon-arrow-left"></span>Showing <?php echo $searchableSubCategories[$subcategories];?></a>
|
| 225 |
</div>
|
225 |
</div>
|
| 226 |
<div class= "inner-addon left-addon" style='padding-top:5px;position: relative;'>
|
226 |
<div class= "inner-addon left-addon" style='padding-top:5px;position: relative;'>
|
| 227 |
<i class="glyphicon glyphicon-search"></i>
|
227 |
<i class="glyphicon glyphicon-search"></i>
|
| 228 |
<input type="text" id= "searchforbrand" placeholder="Search brands or models" class="input-block-level">
|
228 |
<input type="text" id= "searchforbrand" placeholder="Search brands or models" class="input-block-level">
|
| 229 |
</div>
|
229 |
</div>
|