Skip to content

Commit

Permalink
closes #1880 for magento 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloebiz committed Feb 23, 2024
1 parent 295c806 commit 2bacffe
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 @@ -347,12 +347,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 2bacffe

Please sign in to comment.