From a73cb1ca955270bf6d9e87e7a558a72a59149fb2 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 28 Nov 2022 10:47:08 +0000 Subject: [PATCH] [FIX] website_sale: add noFuzzy when it's active `website_sale` module has custom handler for form submit event. That handler ignores `noFuzzy` attribute. As result, adding `data-no-fuzzy="1"` to `input[name=search]` works everywhere, but not on shop product list pages. STEPS: 1. Settings > Technical > Views > website_search_box_input & website_search_box > Code in data-no-fuzzy="1" into the tag 2. Go to Website >.Shop > Customize > Enable ecommerce categories 3. Search for a product on the main shopping page and enter > Observe the URL > There is no noFuzzy param 4. Go to any product's page on the website > search for a product through the search bar and enter > Observe the URL > there is a noFuzzy param passed opw-3051319 closes odoo/odoo#107771 X-original-commit: 1df3b14f86bada2e2cf278d2b4e591996e9e8db8 Signed-off-by: William Braeckman (wbr) --- addons/website_sale/static/src/js/website_sale.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js index bab866f7614..c963c1b0ef3 100644 --- a/addons/website_sale/static/src/js/website_sale.js +++ b/addons/website_sale/static/src/js/website_sale.js @@ -780,6 +780,9 @@ publicWidget.registry.WebsiteSale = publicWidget.Widget.extend(VariantMixin, car ev.preventDefault(); var oldurl = $this.attr('action'); oldurl += (oldurl.indexOf("?")===-1) ? "?" : ""; + if ($this.find('[name=noFuzzy]').val() === "true") { + oldurl += '&noFuzzy=true'; + } var search = $this.find('input.search-query'); window.location = oldurl + '&' + search.attr('name') + '=' + encodeURIComponent(search.val()); }