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
commit 9cce19a65c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,8 +162,9 @@ $.extend(shopping_cart, {
.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 @@ $.extend(shopping_cart, {
.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);
}
}
});