Merge pull request #17438 from netchampfaris/cart-route
fix(cart): Don't use window.open as it can be blocked
diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js
index 983898b..4c35dd0 100644
--- a/erpnext/templates/includes/cart.js
+++ b/erpnext/templates/includes/cart.js
@@ -162,8 +162,9 @@
.html(msg || frappe._("Something went wrong!"))
.toggle(true);
} else {
- window.open('/orders/' + encodeURIComponent(r.message), '_blank');
- window.location.reload();
+ $('.cart-container table').hide();
+ $(btn).hide();
+ window.location.href = '/orders/' + encodeURIComponent(r.message);
}
}
});
@@ -186,8 +187,9 @@
.html(msg || frappe._("Something went wrong!"))
.toggle(true);
} else {
- window.open('/printview?doctype=Quotation&name=' + r.message, '_blank');
- window.location.reload();
+ $('.cart-container table').hide();
+ $(btn).hide();
+ window.location.href = '/quotations/' + encodeURIComponent(r.message);
}
}
});