[FIX] website_sale: keep "sorting by" on searching by attributes

Searching by attributes works via a separate form. It has a copy of other search
parameters (`category`, `search`), but not `order`.

STEPS

1) enable View "Products Attribute's Filters" in eCommerce
2) enable View "Show Sort by" in eCommerce
3) Set sorting to specific value
4) Change Product Filters Attribute values
5) as you can see, the sorting set in Pt3 is lost....

opw-2956280

closes odoo/odoo#98716

X-original-commit: 7e9afa3f167bd3251984c2027fb50f127bc002c2
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This commit is contained in:
Ivan Yelizariev
2022-08-23 17:55:38 +02:00
parent bb4324a69e
commit f478362f52
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -417,6 +417,7 @@ class WebsiteSale(http.Controller):
values = {
'search': fuzzy_search_term or search,
'original_search': fuzzy_search_term and search,
'order': post.get('order', ''),
'category': category,
'attrib_values': attrib_values,
'attrib_set': attrib_set,
+1
View File
@@ -514,6 +514,7 @@
<form class="js_attributes mb-2" method="get">
<input t-if="category" type="hidden" name="category" t-att-value="category.id" />
<input type="hidden" name="search" t-att-value="search" />
<input type="hidden" name="order" t-att-value="order"/>
<a t-if="attrib_values" t-att-href="keep('/shop'+ ('/category/'+slug(category)) if category else None, attrib=0)" class="btn btn-light btn-block py-0 mb-2">
<small><b>Clear Filters</b></small><b class="pull-right">&#215;</b>
</a>