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 1919use Magento \Customer \Model \Delegation \Data \NewOperationFactory ;
2020use Magento \Customer \Api \Data \CustomerInterfaceFactory ;
2121use Magento \Customer \Api \Data \AddressInterfaceFactory ;
22+ use Magento \Framework \Api \CustomAttributesDataInterface ;
2223use Psr \Log \LoggerInterface ;
2324
2425/**
@@ -134,9 +135,22 @@ public function consumeNewOperation()
134135 );
135136 $ addressData ['region ' ] = $ region ;
136137 }
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 (
138146 ['data ' => $ addressData ]
139147 );
148+
149+ foreach ($ customAttributes as $ attributeCode => $ attributeValue ) {
150+ $ address ->setCustomAttribute ($ attributeCode , $ attributeValue );
151+ }
152+
153+ $ addresses [] = $ address ;
140154 }
141155 $ customerData = $ serialized ['customer ' ];
142156 $ customerData ['addresses ' ] = $ addresses ;
Original file line number Diff line number Diff line change 1111use Magento \Customer \Api \Data \AddressInterface ;
1212use Magento \Customer \Api \Data \CustomerInterface ;
1313use Magento \Customer \Api \Data \CustomerInterfaceFactory ;
14+ use Magento \Framework \Api \AttributeInterface ;
1415use Magento \Sales \Api \Data \OrderAddressInterface ;
1516use Magento \Sales \Model \Order ;
1617use Magento \Sales \Model \OrderFactory ;
@@ -126,6 +127,7 @@ private function compareAddresses(
126127 /**
127128 * @magentoDbIsolation enabled
128129 * @magentoAppIsolation enabled
130+ * @magentoDataFixture Magento/Customer/_files/attribute_user_defined_address.php
129131 * @magentoDataFixture Magento/Sales/_files/order.php
130132 * @return void
131133 */
You can’t perform that action at this time.
0 commit comments