Merge pull request #17438 from netchampfaris/cart-route

fix(cart): Don't use window.open as it can be blocked
This commit is contained in:
Nabin Hait
2019-05-02 03:17:58 +05:30
committed by GitHub

View File

@@ -162,8 +162,9 @@ $.extend(shopping_cart, {
.html(msg || frappe._("Something went wrong!")) .html(msg || frappe._("Something went wrong!"))
.toggle(true); .toggle(true);
} else { } else {
window.open('/orders/' + encodeURIComponent(r.message), '_blank'); $('.cart-container table').hide();
window.location.reload(); $(btn).hide();
window.location.href = '/orders/' + encodeURIComponent(r.message);
} }
} }
}); });
@@ -186,8 +187,9 @@ $.extend(shopping_cart, {
.html(msg || frappe._("Something went wrong!")) .html(msg || frappe._("Something went wrong!"))
.toggle(true); .toggle(true);
} else { } else {
window.open('/printview?doctype=Quotation&name=' + r.message, '_blank'); $('.cart-container table').hide();
window.location.reload(); $(btn).hide();
window.location.href = '/quotations/' + encodeURIComponent(r.message);
} }
} }
}); });