From 16065f3ee2f02aba9b7a78f24522fc561cbdc2fe Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 20 Dec 2017 12:24:03 +0100 Subject: [PATCH] [FIX] website_sale: hide checkout btn on emptied cart in all languages When an user goes to its cart and removes all the items, the checkout button is hidden so that the user cannot start an order with no product. This behavior was not working in languages which are not the default language of the website, as the button was found in JS relying on the fact it started by "/shop/checkout", while it can be something like "/fr_FR/shop/checkout". Closes https://github.com/odoo/odoo/issues/21722 --- addons/website_sale/static/src/js/website_sale.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js index 32c18cb4d5b..914b76c56e0 100644 --- a/addons/website_sale/static/src/js/website_sale.js +++ b/addons/website_sale/static/src/js/website_sale.js @@ -190,7 +190,7 @@ $('.oe_website_sale').each(function () { } else { $q.parent().parent().addClass("hidden"); - $('a[href^="/shop/checkout"]').addClass("hidden") + $('a[href*="/shop/checkout"]').addClass("hidden"); } $q.html(data.cart_quantity).hide().fadeIn(600);