Skip to content

Commit 5b44987

Browse files
MC-34264: Shipping Method Estimator not working with custom address attributes
1 parent 1ee7e1f commit 5b44987

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ define([
8484
quoteAddressToFormAddressData: function (addrs) {
8585
var self = this,
8686
output = {},
87-
streetObject;
87+
streetObject,
88+
customAttributesObject;
8889

8990
$.each(addrs, function (key) {
9091
if (addrs.hasOwnProperty(key) && !$.isFunction(addrs[key])) {
@@ -100,6 +101,14 @@ define([
100101
output.street = streetObject;
101102
}
102103

104+
if ($.isArray(addrs.customAttributes)) {
105+
customAttributesObject = {};
106+
addrs.customAttributes.forEach(function (value, index) {
107+
customAttributesObject[value.attribute_code] = value.value;
108+
});
109+
output.custom_attributes = customAttributesObject;
110+
}
111+
103112
return output;
104113
},
105114

0 commit comments

Comments
 (0)