Skip to content

Commit

Permalink
Merge pull request #1882 from mailchimp/Issue1880-2.3.6-p1
Browse files Browse the repository at this point in the history
closes #1880 for magento 2.3.6-p1
  • Loading branch information
gonzaloebiz authored Feb 23, 2024
2 parents 700cd09 + c5de251 commit bcdad5e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Cron/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,18 @@ 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 bcdad5e

Please sign in to comment.