Skip to content

Commit

Permalink
Merge pull request #1017 from mailchimp/issue989-2.2
Browse files Browse the repository at this point in the history
closes #989 for magento 2.2
  • Loading branch information
gonzaloebiz authored Jul 2, 2020
2 parents 5708709 + bcdfa56 commit ce53970
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Cron/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,16 @@ protected function _processMerges(\Magento\Customer\Model\Customer $customer, $d
if (is_array($mapFields)) {
foreach ($mapFields as $map) {
if ($map['mailchimp'] == $key) {
if (!$map['isAddress']) {
$customer->setData($map['customer_field'], $value);
if (!$map['isAddress']&&$map['customer_field'] != "dob") {
if (count($map['options'])) {
foreach($map['options'] as $option) {
if ($option['label'] == $value) {
$customer->setData($map['customer_field'], $option['value']);
}
}
} else {
$customer->setData($map['customer_field'], $value);
}
}
}
}
Expand Down

0 comments on commit ce53970

Please sign in to comment.