Skip to content

Commit ceba72d

Browse files
committed
Fixes exception when posting mutlidimensional array to mailchimp
1 parent fdda86f commit ceba72d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/DataGenerator/StoreDataGenerator.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ public function generate(AudienceInterface $audience): array
3434

3535
$shopBillingData = $channel->getShopBillingData();
3636
if (null !== $shopBillingData) {
37-
$data['address']['address1'] = $shopBillingData->getStreet();
38-
$data['address']['city'] = $shopBillingData->getCity();
39-
$data['address']['postal_code'] = $shopBillingData->getPostcode();
40-
$data['address']['country_code'] = $shopBillingData->getCountryCode();
37+
$data['address'] = (object) [
38+
'address1' => $shopBillingData->getStreet(),
39+
'city' => $shopBillingData->getCity(),
40+
'postal_code' => $shopBillingData->getPostcode(),
41+
'country_code' => $shopBillingData->getCountryCode(),
42+
];
4143

4244
$data['timezone'] = self::getTimeZone($shopBillingData->getCountryCode());
4345
}

0 commit comments

Comments
 (0)