Skip to content

Commit 6c93c05

Browse files
author
Anna Bukatar
committed
ACP2E-1762: Page is not redirecting to the order page with multiple store views
1 parent a047c76 commit 6c93c05

File tree

2 files changed

+22
-3
lines changed
  • app/code/Magento/Sales/view/adminhtml/web/order/create
  • dev/tests/js/jasmine/tests/app/code/Magento/Sales/adminhtml/js/order/create

2 files changed

+22
-3
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,14 @@
157157
this.sidebarShow();
158158
//this.loadArea(['header', 'sidebar','data'], true);
159159
this.dataShow();
160-
this.loadArea(['header', 'data'], true);
161-
location.reload();
160+
this.loadArea(
161+
['header', 'data'],
162+
true,
163+
null,
164+
function () {
165+
location.reload();
166+
}
167+
);
162168
},
163169

164170
setCurrencyId: function (id) {
@@ -1164,7 +1170,7 @@
11641170
}
11651171
},
11661172

1167-
loadArea: function (area, indicator, params) {
1173+
loadArea: function (area, indicator, params, callback) {
11681174
var deferred = new jQuery.Deferred();
11691175
var url = this.loadBaseUrl;
11701176
if (area) {
@@ -1183,6 +1189,9 @@
11831189
onSuccess: function (transport) {
11841190
var response = transport.responseText.evalJSON();
11851191
this.loadAreaResponseHandler(response);
1192+
if (callback instanceof Function) {
1193+
callback();
1194+
}
11861195
deferred.resolve();
11871196
}.bind(this)
11881197
});

dev/tests/js/jasmine/tests/app/code/Magento/Sales/adminhtml/js/order/create/scripts.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,16 @@ define([
160160
jQueryAjax = undefined;
161161
});
162162

163+
it('test that setStoreId calls loadArea with a callback', function () {
164+
init();
165+
spyOn(order, 'loadArea').and.callFake(function () {
166+
expect(arguments.length).toEqual(4);
167+
expect(arguments[3] instanceof Function).toBeTrue();
168+
});
169+
order.setStoreId('id');
170+
expect(order.loadArea).toHaveBeenCalled();
171+
});
172+
163173
describe('Testing the process customer group change', function () {
164174
it('and confirm method is called', function () {
165175
init();

0 commit comments

Comments
 (0)