| 20236 |
naman |
1 |
<style>
|
|
|
2 |
html, body{
|
|
|
3 |
background-color : #fff;
|
|
|
4 |
}
|
|
|
5 |
|
|
|
6 |
.inner-addon .glyphicon {
|
|
|
7 |
top : 0px;
|
|
|
8 |
position: absolute;
|
|
|
9 |
padding: 13px;
|
|
|
10 |
/* pointer-events: none; */
|
|
|
11 |
}
|
|
|
12 |
.left-addon .glyphicon { left: 0px;}
|
|
|
13 |
.left-addon input { padding:5px 6px 3px 36px; }
|
|
|
14 |
|
|
|
15 |
#srch-term:focus{
|
|
|
16 |
/* border:1px solid white; */
|
|
|
17 |
outline-offset: 0px;
|
|
|
18 |
outline: none !important;
|
|
|
19 |
}
|
|
|
20 |
|
|
|
21 |
.ui-autocomplete li{
|
|
|
22 |
list-style-type: none;
|
|
|
23 |
padding : 7px;
|
|
|
24 |
/* font-weight : bold; */
|
|
|
25 |
font-size : 13px;
|
|
|
26 |
color : #d6d6c2;
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
.ui-autocomplete {
|
|
|
31 |
background : #f5f5ef;
|
|
|
32 |
}
|
|
|
33 |
.blue{
|
|
|
34 |
color : #00cccc;
|
|
|
35 |
}
|
|
|
36 |
</style>
|
|
|
37 |
|
|
|
38 |
<script type="text/javascript" src="/js/jquery-ui.min.js "></script>
|
|
|
39 |
<script type="text/javascript" src="/js/jquery.ui.autocomplete.js"></script>
|
|
|
40 |
<script>
|
|
|
41 |
$(document).ready(function(){
|
|
|
42 |
if($('.cscrollselector > a >.card').length>0) {
|
|
|
43 |
$('.cscrollselector').jscroll({
|
|
|
44 |
loadingHtml: '<center><img src="/img/ajax-loader.gif" alt="Loading" /></center>',
|
|
|
45 |
autoTriggerUntil: 3,
|
|
|
46 |
padding: 20
|
|
|
47 |
});
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
var currencies ;
|
|
|
51 |
$('.searchresults a').click(function(){
|
|
|
52 |
var product_rank = $(this).data('rank');
|
|
|
53 |
var search_term = $('.searchterm').text().trim();
|
|
|
54 |
var product_id = $(this).data('id');
|
|
|
55 |
var product_title = $(this).data('title');
|
|
|
56 |
$.ajax({
|
|
|
57 |
method: "POST",
|
|
|
58 |
url: "/search_analytics/add",
|
|
|
59 |
dataType: 'json',
|
|
|
60 |
data: { user_id:me, sku:product_id , name:product_title ,rank:product_rank, search_term: search_term }
|
|
|
61 |
})
|
|
|
62 |
.done(function( msg ) {
|
|
|
63 |
// alert( "Data Saved: " + msg );
|
|
|
64 |
})
|
|
|
65 |
.fail(function(msg){
|
|
|
66 |
// alert("Error");
|
|
|
67 |
});
|
|
|
68 |
});
|
|
|
69 |
|
|
|
70 |
$('.searchbar1 input').click(function(){
|
|
|
71 |
$('.searchbar1').addClass('hidden');
|
|
|
72 |
$('.searchbar').removeClass('hidden');
|
|
|
73 |
$('.searchbar input').focus();
|
|
|
74 |
$('.searchresults').empty();
|
|
|
75 |
});
|
|
|
76 |
|
|
|
77 |
$('.inner-addon span').click(function(){
|
|
|
78 |
$('.searchbar').addClass('hidden');
|
|
|
79 |
$('.searchbar1').removeClass('hidden');
|
|
|
80 |
});
|
|
|
81 |
|
|
|
82 |
|
|
|
83 |
$("#srch-term").autocomplete({ autoFocus: true, minLength: 0,
|
|
|
84 |
source: "/store_products/autosuggest",
|
|
|
85 |
select: function( event, ui ) {
|
|
|
86 |
this.value = ui.item.title;
|
|
|
87 |
$('#formSearch').submit();
|
|
|
88 |
return false;
|
|
|
89 |
}
|
|
|
90 |
});
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
});
|
|
|
94 |
</script>
|
|
|
95 |
|
|
|
96 |
<div class="searchbar hidden">
|
|
|
97 |
<form id = "formSearch" class="navbar-form" role="search" method="GET" name="search" style="padding: 0px 16px;margin-top: 0px;">
|
|
|
98 |
|
|
|
99 |
<div class="input-group col-xs-12 text-right" id="remote">
|
|
|
100 |
|
|
|
101 |
<div class= "inner-addon left-addon" style='position: relative;'>
|
|
|
102 |
<span class="glyphicon glyphicon-arrow-left remsearch"></span>
|
|
|
103 |
<input autocomplete="off" type="text" id= "srch-term" class="input-block-level" style="height:37px" placeholder="Search for items" name="q" >
|
|
|
104 |
</div>
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
|
|
|
109 |
<!-- <input autocomplete="off" type="text" class="form-control" placeholder="Search for items" name="q" id="srch-term" style="width:80%;"> -->
|
|
|
110 |
<div class="input-group-btn w25px">
|
|
|
111 |
<button class="btn btn-default" type="submit" style="height:37px"><i class="glyphicon glyphicon-search"></i></button>
|
|
|
112 |
</div>
|
|
|
113 |
</div>
|
|
|
114 |
</form>
|
|
|
115 |
</div>
|
|
|
116 |
<div class="container">
|
|
|
117 |
<div class="searchbar1" style="margin-top: 15px;margin-bottom: 3px;">
|
|
|
118 |
<!-- <form class="navbar-form" role="search" method="GET" name="search"> -->
|
|
|
119 |
<div class="input-group col-xs-12 text-right" id="remote">
|
|
|
120 |
<input autocomplete="off" type="text" class="form-control" style="width:100%;" placeholder="Search for items">
|
|
|
121 |
<div class="input-group-btn w25px">
|
|
|
122 |
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
|
|
|
123 |
</div>
|
|
|
124 |
</div>
|
|
|
125 |
<!-- </form> -->
|
|
|
126 |
</div>
|
|
|
127 |
<div class="searchresults">
|
|
|
128 |
<?php //debug($result);?>
|
|
|
129 |
<?php if(!empty($result)):?>
|
|
|
130 |
<div class="searchterm" style="background-color: #f5f5f5; margin: 0px 0px;">
|
|
|
131 |
<?php echo $q;?> <!--(<?php //echo sizeof($result['Solr']);?> results)-->
|
|
|
132 |
</div>
|
|
|
133 |
<div class="row scroll cscrollselector">
|
|
|
134 |
<?php echo $this->element('newsearchresult');?>
|
|
|
135 |
</div>
|
|
|
136 |
<?php endif;?>
|
|
|
137 |
<?php if(!empty($campaigns)):?>
|
|
|
138 |
<?php foreach ($campaigns as $key => $campaign):?>
|
|
|
139 |
<?php echo $this->element('searchbanners',array('campaign'=>$campaign));?>
|
|
|
140 |
<?php endforeach;?>
|
|
|
141 |
<?php endif;?>
|
|
|
142 |
</div>
|
|
|
143 |
</div>
|
|
|
144 |
<?php echo $this->element('unlikemodal');?>
|
|
|
145 |
<!-- <script type="text/javascript" src="/js/bootstrap-typeahead.js?v=<?php //echo $staticversion;?>"></script> -->
|
|
|
146 |
|
|
|
147 |
<script type="text/javascript" src="/js/profittill.js?v=<?php echo $staticversion;?>"></script>
|
|
|
148 |
<script type="text/javascript" src="/js/jquery.jscroll.min.js?v=<?php echo $staticversion;?>"></script>
|