Skip to content

Commit

Permalink
Merge pull request #1917 from mailchimp/Issue1914-2.3
Browse files Browse the repository at this point in the history
closes #1914 for magento 2.3
  • Loading branch information
gonzaloebiz committed Mar 5, 2024
2 parents 5c5cdee + 34beb7a commit 5a40c39
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Cron/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,17 @@ protected function _loadGroups()
continue;
} else {
$api = $this->_helper->getApi($storeId);
$interestsCat = $api->lists->interestCategory->getAll($listId, null, null, 200);
if (isset($interestsCat['categories'])) {
foreach ($interestsCat['categories'] as $cat) {
$interests = $api->lists->interestCategory->interests->getAll($listId, $cat['id'], null, null, 200);
$this->groups = array_merge_recursive($this->groups, $interests['interests']);
try {
$interestsCat = $api->lists->interestCategory->getAll($listId, null, null, 200);
if (isset($interestsCat['categories'])) {
foreach ($interestsCat['categories'] as $cat) {
$interests = $api->lists->interestCategory->interests->getAll($listId, $cat['id'], null, null, 200);
$this->groups = array_merge_recursive($this->groups, $interests['interests']);
}
}
} catch (\Mailchimp_Error $e) {
$error = $e->getMessage();
$this->_helper->log("Error: [$error] for store [$storeId]");
}
}
}
Expand Down

0 comments on commit 5a40c39

Please sign in to comment.