Skip to content

Commit b5045c4

Browse files
authored
Fix customer group update confirm
Was broken with commit faa5f9a#diff-47459785dc7008bc9145a9609c9c7f6c and never fixed.
1 parent b817af4 commit b5045c4

File tree

1 file changed

+13
-7
lines changed
  • app/code/Magento/Sales/view/adminhtml/web/order/create

1 file changed

+13
-7
lines changed

app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,14 +1493,20 @@ define([
14931493
}
14941494

14951495
if (action === 'change') {
1496-
var confirmText = message.replace(/%s/, customerGroupOption.text);
1496+
var self = this,
1497+
confirmText = message.replace(/%s/, customerGroupOption.text);
14971498
confirmText = confirmText.replace(/%s/, currentCustomerGroupTitle);
1498-
if (confirm(confirmText)) {
1499-
$$('#' + groupIdHtmlId + ' option').each(function (o) {
1500-
o.selected = o.readAttribute('value') == groupId;
1501-
});
1502-
this.accountGroupChange();
1503-
}
1499+
confirm({
1500+
content: confirmText,
1501+
actions: {
1502+
confirm: function() {
1503+
$$('#' + groupIdHtmlId + ' option').each(function (o) {
1504+
o.selected = o.readAttribute('value') == groupId;
1505+
});
1506+
self.accountGroupChange();
1507+
}
1508+
}
1509+
})
15041510
} else if (action === 'inform') {
15051511
alert({
15061512
content: message + '\n' + groupMessage

0 commit comments

Comments
 (0)