| 13815 |
anikendra |
1 |
<div class="container">
|
|
|
2 |
<div class="searchbar">
|
|
|
3 |
<form class="navbar-form" role="search" method="GET" name="search">
|
|
|
4 |
<div class="input-group col-xs-12 text-right">
|
| 14215 |
anikendra |
5 |
<input type="text" class="form-control typeahead" placeholder="Search for items" name="q" id="srch-term">
|
| 13815 |
anikendra |
6 |
<div class="input-group-btn w25px">
|
|
|
7 |
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
|
|
|
8 |
</div>
|
|
|
9 |
</div>
|
|
|
10 |
</form>
|
|
|
11 |
</div>
|
|
|
12 |
<div class="searchresults">
|
| 13901 |
anikendra |
13 |
<?php if(!empty($result)):?>
|
| 13815 |
anikendra |
14 |
<div class="searchterm">
|
| 13901 |
anikendra |
15 |
<?php echo $q;?> <!--(<?php //echo sizeof($result['Solr']);?> results)-->
|
| 13815 |
anikendra |
16 |
</div>
|
| 13901 |
anikendra |
17 |
<div class="scroll">
|
|
|
18 |
<?php echo $this->element('searchresult');?>
|
|
|
19 |
</div>
|
|
|
20 |
<?php endif;?>
|
| 13815 |
anikendra |
21 |
</div>
|
| 13901 |
anikendra |
22 |
</div>
|
| 14215 |
anikendra |
23 |
<script type="text/javascript" src="/js/bower_components/typeahead.js/dist/typeahead.bundle.min.js"></script>
|
|
|
24 |
<script type="text/javascript">
|
|
|
25 |
var products = new Bloodhound({
|
|
|
26 |
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('val'),
|
|
|
27 |
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
|
|
28 |
// prefetch: '<?php echo $base_url;?>autosuggest.json',
|
|
|
29 |
remote: '<?php echo $base_url;?>autosuggest.json',
|
|
|
30 |
});
|
|
|
31 |
|
|
|
32 |
products.initialize();
|
|
|
33 |
|
|
|
34 |
$('.typeahead').typeahead(null, {
|
|
|
35 |
name: 'products',
|
|
|
36 |
displayKey: 'val',
|
|
|
37 |
source: products.ttAdapter()
|
|
|
38 |
});
|
|
|
39 |
</script>
|
|
|
40 |
<!-- <script type="text/javascript" src="/js/profittill.js?v=<?php echo $staticversion;?>"></script>-->
|