Skip to content

Commit 6826ade

Browse files
committed
ACP2E-3294: The shipping address state is not auto updating
1 parent 3c83d94 commit 6826ade

File tree

1 file changed

+15
-0
lines changed
  • app/code/Magento/Sales/view/adminhtml/web/order/create

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@
246246
* @param {Event} event
247247
*/
248248
changeAddressField: function (event) {
249+
console.trace();
249250
var field = Event.element(event),
250251
re = /[^\[]*\[([^\]]*)_address\]\[([^\]]*)\](\[(\d)\])?/,
251252
matchRes = field.name.match(re),
@@ -326,12 +327,26 @@
326327

327328
if (this.isBillingField(fieldName)) {
328329
syncName = fieldName.replace('billing', 'shipping');
330+
331+
if (fieldName.indexOf('country')) {
332+
jQuery('#order-shipping_address_region').css(
333+
'display',
334+
jQuery('#order-billing_address_region').css('display')
335+
);
336+
jQuery('#order-shipping_address_region_id').css(
337+
'display',
338+
jQuery('#order-billing_address_region_id').css('display')
339+
);
340+
}
329341
}
330342

331343
$(container).select('[name="' + syncName + '"]').each(function (element) {
332344
if (~['input', 'textarea', 'select'].indexOf(element.tagName.toLowerCase())) {
333345
if (element.type === "checkbox") {
334346
element.checked = fieldValue.checked;
347+
} else if (element.type === "select" || element.type === "select-one") {
348+
element.innerHTML = fieldValue.innerHTML;
349+
element.value = fieldValue.value;
335350
} else {
336351
element.value = fieldValue.value;
337352
}

0 commit comments

Comments
 (0)