Skip to content

Commit

Permalink
Merge pull request #933 from mailchimp/Issue932-2.3
Browse files Browse the repository at this point in the history
closes #932 for magento 2.3
  • Loading branch information
gonzaloebiz authored Dec 4, 2019
2 parents 5236f96 + 72e2510 commit 9132164
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ public function getInterest($storeId)
}
} else {
$this->log(__('Error retrieving interest groups for store ').$storeId);
$rc = [];
}
} catch (\Mailchimp_Error $e) {
$this->log($e->getFriendlyMessage());
Expand All @@ -1115,12 +1116,12 @@ public function getSubscriberInterest($subscriberId, $storeId, $interest = null)
$interestGroup = $this->_interestGroupFactory->create();
$interestGroup->getBySubscriberIdStoreId($subscriberId, $storeId);
$serialized = $interestGroup->getGroupdata();
if ($serialized) {
if ($serialized&&is_array($interest)&&count($interest)) {
try {
$groups = $this->unserialize($serialized);
if (isset($groups['group'])) {
foreach ($groups['group'] as $key => $value) {
if (isset($interest[$key])) {
if (array_key_exists($interest,$key)) {
if (is_array($value)) {
foreach ($value as $groupId) {
foreach ($interest[$key]['category'] as $gkey => $gvalue) {
Expand Down

0 comments on commit 9132164

Please sign in to comment.