Skip to content

Commit 946d556

Browse files
committed
[BUGFIX] Solved invalid address extension_attributes for new shipping address
1 parent 04396e6 commit 946d556

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.2.1 (2021-02-08)
2+
3+
[View Release](git@github.com:experius/Magento-2-Module-Experius-ExtraCheckoutAddressFields.git/commits/tag/1.2.1)
4+
5+
* [BUGFIX] Solved invalid address extension_attributes for new shipping address *(Lewis Voncken)*
6+
7+
18
## 1.2.0 (2020-08-24)
29

310
[View Release](git@github.com:experius/Magento-2-Module-Experius-ExtraCheckoutAddressFields.git/commits/tag/1.2.0)

view/frontend/web/js/action/create-shipping-address-mixin.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@ define([
88
return function (setShippingInformationAction) {
99
return wrapper.wrap(setShippingInformationAction, function (originalAction, messageContainer) {
1010

11+
if (messageContainer['extension_attributes'] === undefined) {
12+
messageContainer['extension_attributes'] = {};
13+
}
1114
if (messageContainer.custom_attributes != undefined) {
1215
$.each(messageContainer.custom_attributes , function( key, value ) {
13-
messageContainer['custom_attributes'][key] = {'attribute_code':key,'value':value};
16+
if($.isPlainObject(value)) {
17+
key = value['attribute_code'];
18+
}
19+
if($.isPlainObject(value)){
20+
value = value['value'];
21+
}
22+
23+
messageContainer['customAttributes'][key] = value;
24+
messageContainer['extension_attributes'][key] = value;
1425
});
1526
}
1627

0 commit comments

Comments
 (0)