File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
app/code/Magento/Customer/Model/Delegation
dev/tests/integration/testsuite/Magento/Sales/Api Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 19
19
use Magento \Customer \Model \Delegation \Data \NewOperationFactory ;
20
20
use Magento \Customer \Api \Data \CustomerInterfaceFactory ;
21
21
use Magento \Customer \Api \Data \AddressInterfaceFactory ;
22
+ use Magento \Framework \Api \CustomAttributesDataInterface ;
22
23
use Psr \Log \LoggerInterface ;
23
24
24
25
/**
@@ -134,9 +135,22 @@ public function consumeNewOperation()
134
135
);
135
136
$ addressData ['region ' ] = $ region ;
136
137
}
137
- $ addresses [] = $ this ->addressFactory ->create (
138
+
139
+ $ customAttributes = [];
140
+ if (!empty ($ addressData [CustomAttributesDataInterface::CUSTOM_ATTRIBUTES ])) {
141
+ $ customAttributes = $ addressData [CustomAttributesDataInterface::CUSTOM_ATTRIBUTES ];
142
+ unset($ addressData [CustomAttributesDataInterface::CUSTOM_ATTRIBUTES ]);
143
+ }
144
+
145
+ $ address = $ this ->addressFactory ->create (
138
146
['data ' => $ addressData ]
139
147
);
148
+
149
+ foreach ($ customAttributes as $ attributeCode => $ attributeValue ) {
150
+ $ address ->setCustomAttribute ($ attributeCode , $ attributeValue );
151
+ }
152
+
153
+ $ addresses [] = $ address ;
140
154
}
141
155
$ customerData = $ serialized ['customer ' ];
142
156
$ customerData ['addresses ' ] = $ addresses ;
Original file line number Diff line number Diff line change 11
11
use Magento \Customer \Api \Data \AddressInterface ;
12
12
use Magento \Customer \Api \Data \CustomerInterface ;
13
13
use Magento \Customer \Api \Data \CustomerInterfaceFactory ;
14
+ use Magento \Framework \Api \AttributeInterface ;
14
15
use Magento \Sales \Api \Data \OrderAddressInterface ;
15
16
use Magento \Sales \Model \Order ;
16
17
use Magento \Sales \Model \OrderFactory ;
@@ -126,6 +127,7 @@ private function compareAddresses(
126
127
/**
127
128
* @magentoDbIsolation enabled
128
129
* @magentoAppIsolation enabled
130
+ * @magentoDataFixture Magento/Customer/_files/attribute_user_defined_address.php
129
131
* @magentoDataFixture Magento/Sales/_files/order.php
130
132
* @return void
131
133
*/
You can’t perform that action at this time.
0 commit comments