From bcdfa566930680e3ba1cfacc6d9708928a3cf5ef Mon Sep 17 00:00:00 2001 From: gonzalo Date: Thu, 2 Jul 2020 08:37:44 -0300 Subject: [PATCH] closes #989 for magento 2.2 --- Cron/Webhook.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Cron/Webhook.php b/Cron/Webhook.php index 6a8307ad..61571b56 100644 --- a/Cron/Webhook.php +++ b/Cron/Webhook.php @@ -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); + } } } }