File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
app/code/Magento/Customer/Model/Address Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -235,6 +235,15 @@ private function getAttributesMeta(Type $entityType): array
235
235
$ customer = $ this ->customerRepository ->getById ($ customerId );
236
236
$ attributes ->setWebsite ($ customer ->getWebsiteId ());
237
237
}
238
+ $ customerAddress = $ customer ->getAddresses ()[0 ];
239
+
240
+ $ customerStreetAddressLines = 0 ;
241
+ if ($ customerAddress !== null ){
242
+ $ customerStreetAddress = $ customerAddress ->getStreet ();
243
+ if ($ customerStreetAddress !== null ){
244
+ $ customerStreetAddressLines = count ($ customerStreetAddress );
245
+ }
246
+ }
238
247
239
248
/* @var AbstractAttribute $attribute */
240
249
foreach ($ attributes as $ attribute ) {
@@ -245,11 +254,16 @@ private function getAttributesMeta(Type $entityType): array
245
254
continue ;
246
255
}
247
256
248
- $ meta [$ attribute ->getAttributeCode ()] = $ this ->attributeMetadataResolver ->getAttributesMeta (
257
+ $ attributeCode = $ attribute ->getAttributeCode ();
258
+ $ meta [$ attributeCode ] = $ this ->attributeMetadataResolver ->getAttributesMeta (
249
259
$ attribute ,
250
260
$ entityType ,
251
261
$ this ->allowToShowHiddenAttributes
252
262
);
263
+ if ($ attributeCode === 'street ' && $ customerStreetAddressLines !== 0 ){
264
+ $ meta [$ attributeCode ]["arguments " ]["data " ]["config " ]["size " ] = max (
265
+ $ meta [$ attributeCode ]["arguments " ]["data " ]["config " ]["size " ],$ customerStreetAddressLines );
266
+ }
253
267
}
254
268
$ this ->attributeMetadataResolver ->processWebsiteMeta ($ meta );
255
269
You can’t perform that action at this time.
0 commit comments