From 8349c4107275637f6a5551fac887297231e51f38 Mon Sep 17 00:00:00 2001 From: gonzalo Date: Mon, 8 Apr 2024 11:15:06 -0300 Subject: [PATCH 1/2] closes #1951 for magento 2.3.6-p1 --- Model/Api/Order.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Model/Api/Order.php b/Model/Api/Order.php index 3e4264ac..68f77393 100644 --- a/Model/Api/Order.php +++ b/Model/Api/Order.php @@ -205,10 +205,6 @@ protected function _getModifiedOrders($magentoStoreId) } $orderJson = $this->generatePOSTPayload($order, $mailchimpStoreId, $magentoStoreId, true, $isSynced); - if ($this->modifiedOrder) { - $order->save(); - $this->modifiedOrder = false; - } if ($orderJson!==false) { if (!empty($orderJson)) { $this->_helper->modifyCounter(\Ebizmarts\MailChimp\Helper\Data::ORD_MOD); @@ -291,10 +287,6 @@ protected function _getNewOrders($magentoStoreId) } } $orderJson = $this->generatePOSTPayload($order, $mailchimpStoreId, $magentoStoreId,false,$isSynced); - if ($this->modifiedOrder) { - $order->save(); - $this->modifiedOrder = false; - } if ($orderJson!==false) { if (!empty($orderJson)) { $this->_helper->modifyCounter(\Ebizmarts\MailChimp\Helper\Data::ORD_NEW); @@ -346,11 +338,10 @@ protected function generatePOSTPayload( if ($order->getMailchimpCampaignId()) { $data['campaign_id'] = $order->getMailchimpCampaignId(); } elseif ($isSynced) { - if ($campaignId = $this->getCampaign($magentoStoreId, $order->getCustomerEmail())) { + if (!$isModifiedOrder && $campaignId = $this->getCampaign($magentoStoreId, $order->getCustomerEmail())) { $data['campaign_id'] = $campaignId; $order->setMailchimpCampaignId($campaignId); $order->setMailchimpFlag(1); - $this->modifiedOrder = true; } } From 81b24f58283818a277c9d2516755bda5007aa15b Mon Sep 17 00:00:00 2001 From: gonzalo Date: Mon, 8 Apr 2024 13:49:59 -0300 Subject: [PATCH 2/2] closes #1951 for magento 2.3.6-p1 --- Model/Api/Order.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Model/Api/Order.php b/Model/Api/Order.php index 68f77393..8f242f28 100644 --- a/Model/Api/Order.php +++ b/Model/Api/Order.php @@ -84,7 +84,6 @@ class Order protected $_counter; protected $_batchId; - protected $modifiedOrder = false; /** * @param \Ebizmarts\MailChimp\Helper\Data $helper