From 626b9902eabe94a6d9a41e8bcdf000f182c334da Mon Sep 17 00:00:00 2001 From: Maxime Leclercq Date: Wed, 7 Jun 2023 17:42:54 +0200 Subject: [PATCH] fix: avoids having buildEcommerceCollectionToSync default condition and those on resource model --- .../community/Ebizmarts/MailChimp/Model/Api/Customers.php | 5 ++++- .../Resource/Ecommercesyncdata/Customers/Collection.php | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/code/community/Ebizmarts/MailChimp/Model/Api/Customers.php b/app/code/community/Ebizmarts/MailChimp/Model/Api/Customers.php index 3d5f70f6b..ca97ef8fb 100755 --- a/app/code/community/Ebizmarts/MailChimp/Model/Api/Customers.php +++ b/app/code/community/Ebizmarts/MailChimp/Model/Api/Customers.php @@ -97,7 +97,10 @@ public function createBatchJson() //****************** $customersCollection = array(); - $collection = $this->buildEcommerceCollectionToSync(Ebizmarts_MailChimp_Model_Config::IS_CUSTOMER); + $collection = $this->buildEcommerceCollectionToSync( + Ebizmarts_MailChimp_Model_Config::IS_CUSTOMER, + 'm4m.mailchimp_sync_delta IS NULL OR m4m.mailchimp_sync_modified = 1' + ); $customerIds = $collection->getAllIds($this->getBatchLimitFromConfig()); //****************** diff --git a/app/code/community/Ebizmarts/MailChimp/Model/Resource/Ecommercesyncdata/Customers/Collection.php b/app/code/community/Ebizmarts/MailChimp/Model/Resource/Ecommercesyncdata/Customers/Collection.php index 09ed33ba5..432c5a2c0 100755 --- a/app/code/community/Ebizmarts/MailChimp/Model/Resource/Ecommercesyncdata/Customers/Collection.php +++ b/app/code/community/Ebizmarts/MailChimp/Model/Resource/Ecommercesyncdata/Customers/Collection.php @@ -35,7 +35,5 @@ public function joinLeftEcommerceSyncData($preFilteredCustomersCollection) array("m4m" => $mailchimpTableName), sprintf($joinCondition, Ebizmarts_MailChimp_Model_Config::IS_CUSTOMER, $this->getMailchimpStoreId()) ); - - $preFilteredCustomersCollection->getSelect()->where("m4m.mailchimp_sync_delta IS null OR m4m.mailchimp_sync_modified = 1"); } }