Skip to content

Commit df17f6a

Browse files
committed
AC-7865::Unable to Place Order via Admin - Unknown or expired payment_method_n
1 parent e6ff98d commit df17f6a

File tree

1 file changed

+43
-8
lines changed
  • app/code/Magento/Sales/view/adminhtml/web/order/create

1 file changed

+43
-8
lines changed

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

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,20 @@ define([
145145
this.customerSelectorHide();
146146
if (this.storeId) {
147147
$(this.getAreaId('data')).callback = 'dataLoaded';
148-
$(this.getAreaId('form')).callback = 'dataLoaded';
149-
this.loadArea(['data', 'form'], true);
148+
this.loadArea(['data'], true);
150149
} else {
151150
this.storeSelectorShow();
152151
}
153152
},
154153

155-
setStoreId: function (id) {
154+
setStoreId: function (id) {
156155
this.storeId = id;
157156
this.storeSelectorHide();
158157
this.sidebarShow();
159-
this.loadArea(['header', 'sidebar','data'], true);
158+
//this.loadArea(['header', 'sidebar','data'], true);
160159
this.dataShow();
161-
/// this.loadArea(['header', 'data', 'form'], true);
160+
this.loadArea(['header', 'data'], true);
161+
location.reload(true);
162162
},
163163

164164
setCurrencyId: function (id) {
@@ -507,7 +507,7 @@ define([
507507
this.loadArea(['card_validation'], true, data);
508508
},
509509

510-
setPaymentMethod: function (method) {
510+
setPaymentMethod: function (method) {
511511
if (this.paymentMethod && $('payment_form_' + this.paymentMethod)) {
512512
var form = 'payment_form_' + this.paymentMethod;
513513
[form + '_before', form, form + '_after'].each(function (el) {
@@ -1164,7 +1164,42 @@ define([
11641164
}
11651165
},
11661166

1167-
1167+
loadArea: function (area, indicator, params) {
1168+
var deferred = new jQuery.Deferred();
1169+
var url = this.loadBaseUrl;
1170+
if (area) {
1171+
area = this.prepareArea(area);
1172+
url += 'block/' + area;
1173+
}
1174+
if (indicator === true) indicator = 'html-body';
1175+
params = this.prepareParams(params);
1176+
params.json = true;
1177+
if (!this.loadingAreas) this.loadingAreas = [];
1178+
if (indicator) {
1179+
this.loadingAreas = area;
1180+
new Ajax.Request(url, {
1181+
parameters: params,
1182+
loaderArea: indicator,
1183+
onSuccess: function (transport) {
1184+
var response = transport.responseText.evalJSON();
1185+
this.loadAreaResponseHandler(response);
1186+
deferred.resolve();
1187+
}.bind(this)
1188+
});
1189+
} else {
1190+
new Ajax.Request(url, {
1191+
parameters: params,
1192+
loaderArea: indicator,
1193+
onSuccess: function (transport) {
1194+
deferred.resolve();
1195+
}
1196+
});
1197+
}
1198+
if (typeof productConfigure != 'undefined' && area instanceof Array && area.indexOf('items') != -1) {
1199+
productConfigure.clean('quote_items');
1200+
}
1201+
return deferred.promise();
1202+
},
11681203

11691204
loadAreaResponseHandler: function (response) {
11701205
if (response.error) {
@@ -1238,7 +1273,7 @@ define([
12381273
return 'order-' + area;
12391274
},
12401275

1241-
prepareParams: function (params) {
1276+
prepareParams: function (params) {
12421277
if (!params) {
12431278
params = {};
12441279
}

0 commit comments

Comments
 (0)