Skip to content

Commit 2203ac6

Browse files
committed
Merge remote-tracking branch 'magento-mpi/MAGETWO-99043' into MPI-PR
2 parents 99f206f + c15e194 commit 2203ac6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ define([
99
'jquery',
1010
'Magento_Checkout/js/model/new-customer-address',
1111
'Magento_Customer/js/customer-data',
12-
'mage/utils/objects'
13-
], function ($, address, customerData, mageUtils) {
12+
'mage/utils/objects',
13+
'underscore'
14+
], function ($, address, customerData, mageUtils, _) {
1415
'use strict';
1516

1617
var countryData = customerData.get('directory-data');
@@ -60,13 +61,15 @@ define([
6061
delete addressData['region_id'];
6162

6263
if (addressData['custom_attributes']) {
63-
addressData['custom_attributes'] = Object.entries(addressData['custom_attributes'])
64-
.map(function (customAttribute) {
64+
addressData['custom_attributes'] = _.map(
65+
addressData['custom_attributes'],
66+
function (value, key) {
6567
return {
66-
'attribute_code': customAttribute[0],
67-
'value': customAttribute[1]
68+
'attribute_code': key,
69+
'value': value
6870
};
69-
});
71+
}
72+
);
7073
}
7174

7275
return address(addressData);

0 commit comments

Comments
 (0)