Skip to content

Commit

Permalink
Merge pull request #1881 from mailchimp/Issue1880-2.4
Browse files Browse the repository at this point in the history
closes #1880 for 2.4
  • Loading branch information
gonzaloebiz committed Feb 23, 2024
2 parents b44f285 + 8460a5e commit ed765f7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Cron/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,17 @@ protected function _loadGroups()
continue;
}
$listId =$this->_helper->getDefaultList($storeId);
$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']);
if (!$listId||$listId==-1) {
$this->_helper->log("ListId [$listId] is invalid for Store [$storeId]");
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']);
}
}
}
}
Expand Down

0 comments on commit ed765f7

Please sign in to comment.