[IMP] website_sale: show number of product found

Now you have the option to show the number of product found after one search.
This commit is contained in:
Jeremy Kersten
2016-08-19 19:33:21 +02:00
parent dedb3ce9ba
commit 1feaee1daa
4 changed files with 8 additions and 10 deletions
@@ -291,11 +291,3 @@ ul.nav-stacked > li > a {
.oe_search_box {
padding-right: 23px;
}
.oe_search_clear {
.o-position-absolute(1px, 42px);
z-index: 2;
display: none;
cursor: pointer;
color: #939393;
padding: 10px 0;
}
@@ -988,7 +988,6 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
<div class="input-group">
<div class="oe_search">
<input type="text" name="search" class="search-query form-control oe_search_box" placeholder="Search..." t-att-value="search" />
<span class="fa fa-remove fa-lg oe_search_clear"></span>
</div>
<span class="input-group-btn">
<button type="submit" class="btn btn-default oe_search_button"><i class="fa fa-search"/></button>
+1
View File
@@ -247,6 +247,7 @@ class WebsiteSale(http.Controller):
'pager': pager,
'pricelist': pricelist,
'products': products,
'search_count': product_count, # common for all searchbox
'bins': TableCompute().process(products, ppg),
'rows': PPR,
'categories': categs,
+7 -1
View File
@@ -39,7 +39,7 @@
</xpath>
</template>
<template id="search" name="Search hidden fields">
<template id="search" name="Search Box">
<form t-att-action="keep('/shop'+ ('/category/'+slug(category)) if category else None, search=0)" method="get" t-att-class="search_class">
<t t-if="attrib_values">
<t t-foreach="attrib_values" t-as="a">
@@ -50,6 +50,12 @@
</form>
</template>
<template id="search count" inherit_id="website.website_search_box" active="False" customize_show="True" name="Show # found">
<xpath expr="//button[contains(@class, 'oe_search_button')]" position="inside">
<span t-if='search and search_count' class='oe_search_found'> <small>(<t t-esc="search_count"/> found)</small></span>
</xpath>
</template>
<template id="404">
<t t-call="website.layout">
<div id="wrap">