From 5f1eebec164237e9b30a78080cd2ab2362f5cf57 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 1 May 2019 14:32:15 +0530 Subject: [PATCH] fix(cart): Don't use window.open as it can be blocked window.open calls are interpreted as popups by some browsers and are blocked. Also, route to Quotation web view instead of printview. --- erpnext/templates/includes/cart.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js index 983898b457b..f26aff487f4 100644 --- a/erpnext/templates/includes/cart.js +++ b/erpnext/templates/includes/cart.js @@ -162,8 +162,7 @@ $.extend(shopping_cart, { .html(msg || frappe._("Something went wrong!")) .toggle(true); } else { - window.open('/orders/' + encodeURIComponent(r.message), '_blank'); - window.location.reload(); + window.location.href = '/orders/' + encodeURIComponent(r.message); } } }); @@ -186,8 +185,7 @@ $.extend(shopping_cart, { .html(msg || frappe._("Something went wrong!")) .toggle(true); } else { - window.open('/printview?doctype=Quotation&name=' + r.message, '_blank'); - window.location.reload(); + window.location.href = '/quotations/' + encodeURIComponent(r.message); } } });