[fix] selecting new address in cart web page unchecks previously checked address
This commit is contained in:
parent
2b9c95a940
commit
0a33d4ffc5
@ -24,6 +24,16 @@ $.extend(shopping_cart, {
|
|||||||
if($(this).prop("checked")) {
|
if($(this).prop("checked")) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
// freeze ui and wait for response:
|
||||||
|
frappe.freeze();
|
||||||
|
|
||||||
|
// uncheck other shipping or billing addresses:
|
||||||
|
if ( $(this).is('input[data-fieldname=customer_address]') ) {
|
||||||
|
$('input[data-fieldname=customer_address]').not(this).prop('checked', false);
|
||||||
|
} else {
|
||||||
|
$('input[data-fieldname=shipping_address_name]').not(this).prop('checked', false);
|
||||||
|
}
|
||||||
|
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
method: "erpnext.shopping_cart.cart.update_cart_address",
|
method: "erpnext.shopping_cart.cart.update_cart_address",
|
||||||
@ -35,6 +45,8 @@ $.extend(shopping_cart, {
|
|||||||
if(!r.exc) {
|
if(!r.exc) {
|
||||||
$(".cart-tax-items").html(r.message.taxes);
|
$(".cart-tax-items").html(r.message.taxes);
|
||||||
}
|
}
|
||||||
|
// unfreeze:
|
||||||
|
frappe.unfreeze();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user