From f36aba31e51ec0b74ab47aba259f448530bcb437 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Tue, 20 Dec 2016 09:55:38 +0100 Subject: [PATCH] [FIX] website_Sale_options: fix regexp to redirect after the add to cart. Previous regexp was done on the complete url and not the path name. In the case of a domain with tld .shop, it didn't work. This commit closes #14756 --- addons/website_sale_options/static/src/js/website_sale.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale_options/static/src/js/website_sale.js b/addons/website_sale_options/static/src/js/website_sale.js index 9f2d704ceab..d9665802a3f 100644 --- a/addons/website_sale_options/static/src/js/website_sale.js +++ b/addons/website_sale_options/static/src/js/website_sale.js @@ -33,7 +33,7 @@ $(document).ready(function () { data: {lang: openerp.website.get_context().lang}, success: function (quantity) { if (!$a.hasClass('js_goto_shop')) { - window.location.href = window.location.href.replace(/shop([\/?].*)?$/, "shop/cart"); + window.location.pathname = window.location.pathname.replace(/shop([\/?].*)?$/, "shop/cart"); } var $q = $(".my_cart_quantity"); $q.parent().parent().removeClass("hidden", !quantity);