From 9dc6309a96379c6ae2bac751376209b3c2effa2f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 22 Apr 2024 06:50:32 +0100 Subject: [PATCH] https://github.com/thehcginstitute-com/m1/issues/572 --- app/code/community/Ebizmarts/MailChimp/Helper/Data.php | 4 ++-- .../community/Ebizmarts/MailChimp/Model/Observer.php | 10 +++++----- app/code/local/HCG/MailChimp/Batch/Commerce.php | 2 +- app/code/local/HCG/MailChimp/Batch/Commerce/Send.php | 2 +- app/code/local/HCG/MailChimp/Batch/GetResults.php | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/code/community/Ebizmarts/MailChimp/Helper/Data.php b/app/code/community/Ebizmarts/MailChimp/Helper/Data.php index fbe462086..5bc51926a 100644 --- a/app/code/community/Ebizmarts/MailChimp/Helper/Data.php +++ b/app/code/community/Ebizmarts/MailChimp/Helper/Data.php @@ -1811,7 +1811,7 @@ function retrieveAndSaveMCJsUrlInConfig(int $scopeId, $scope = 'stores') { $mcJsUrlSaved = false; try { $api = $this->getApi($scopeId, $scope); - $mcStore = hcg_mc_sid($scopeId); /** @var ?string $mcStore */ + $mcStore = hcg_mc_sid($scopeId); /** @var string $mcStore */ $response = $api->getEcommerce()->getStores()->get($mcStore, 'connected_site'); if (isset($response['connected_site']['site_script']['url'])) { $url = $response['connected_site']['site_script']['url']; @@ -2169,7 +2169,7 @@ function isCheckoutSubscribeEnabled($scopeId, $scope = 'stores') function setIsSyncingIfFinishedPerScope($syncValue, int $scopeId, $scope = 'stores') { try { $mailchimpApi = $this->getApi($scopeId, $scope); - $mcStore = hcg_mc_sid($scopeId); /** @var ?string $mcStore */ + $mcStore = hcg_mc_sid($scopeId); /** @var string $mcStore */ $isSyncing = $this->getMCIsSyncing($mcStore, $scopeId, $scope); if ($mcStore && $isSyncing != 1) { $this->getApiStores()->editIsSyncing($mailchimpApi, $syncValue, $mcStore); diff --git a/app/code/community/Ebizmarts/MailChimp/Model/Observer.php b/app/code/community/Ebizmarts/MailChimp/Model/Observer.php index 0787fecd5..a0e3c04fa 100644 --- a/app/code/community/Ebizmarts/MailChimp/Model/Observer.php +++ b/app/code/community/Ebizmarts/MailChimp/Model/Observer.php @@ -436,7 +436,7 @@ function newOrder(Varien_Event_Observer $observer) if ($this->isBundleItem($item) || $this->isConfigurableItem($item)) { continue; } - $mcStore = hcg_mc_sid($storeId); /** @var ?string $mcStore */ + $mcStore = hcg_mc_sid($storeId); /** @var string $mcStore */ $productId = (int)$item->getProductId(); $dataProduct = hcg_mc_syncd_get( $productId, @@ -730,7 +730,7 @@ function newCreditMemo(Varien_Event_Observer $observer) { $apiOrder = $this->makeApiOrder(); if ($ecomEnabled) { - $mcStore = hcg_mc_sid($storeId); /** @var ?string $mcStore */ + $mcStore = hcg_mc_sid($storeId); /** @var string $mcStore */ $apiProduct->setMailchimpStoreId($mcStore); $apiProduct->setMagentoStoreId($storeId); $items = $creditMemo->getAllItems(); @@ -794,7 +794,7 @@ function cancelCreditMemo(Varien_Event_Observer $observer) $apiProduct = $this->makeApiProduct(); $apiOrder = $this->makeApiOrder(); if ($ecomEnabled) { - $mcStore = hcg_mc_sid($storeId); /** @var ?string $mcStore */ + $mcStore = hcg_mc_sid($storeId); /** @var string $mcStore */ $apiProduct->setMagentoStoreId($storeId); $apiProduct->setMailchimpStoreId($mcStore); $items = $creditMemo->getAllItems(); @@ -832,7 +832,7 @@ function itemCancel(Varien_Event_Observer $observer) { $ecomEnabled = $helper->isEcomSyncDataEnabled($storeId); $apiProduct = $this->makeApiProduct(); if ($ecomEnabled) { - $mcStore = hcg_mc_sid($storeId); /** @var ?string $mcStore */ + $mcStore = hcg_mc_sid($storeId); /** @var string $mcStore */ $apiProduct->setMailchimpStoreId($mcStore); $apiProduct->setMagentoStoreId($storeId); $productId = (int)$item->getProductId(); @@ -863,7 +863,7 @@ function productSaveAfter(Varien_Event_Observer $observer) { foreach ($stores as $storeId => $store) { /** @var int $storeId */ $ecommEnabled = $helper->isEcommerceEnabled($storeId); if ($ecommEnabled) { - $mcStore = hcg_mc_sid($storeId); /** @var ?string $mcStore */ + $mcStore = hcg_mc_sid($storeId); /** @var string $mcStore */ $apiProduct->setMailchimpStoreId($mcStore); $apiProduct->setMagentoStoreId($storeId); $status = $this->getCatalogProductStatusModel()->getProductStatus($product->getId(), $storeId); diff --git a/app/code/local/HCG/MailChimp/Batch/Commerce.php b/app/code/local/HCG/MailChimp/Batch/Commerce.php index d3b217c19..348e2b64c 100644 --- a/app/code/local/HCG/MailChimp/Batch/Commerce.php +++ b/app/code/local/HCG/MailChimp/Batch/Commerce.php @@ -48,7 +48,7 @@ private static function addSyncValueToArray(int $storeId, $syncedDateArray) { $h = hcg_mc_h(); $ecomEnabled = $h->isEcomSyncDataEnabled($storeId); if ($ecomEnabled) { - $mcStore = hcg_mc_sid($storeId); /** @var ?string $mcStore */ + $mcStore = hcg_mc_sid($storeId); /** @var string $mcStore */ $syncedDate = $h->getMCIsSyncing($mcStore, $storeId); // Check if $syncedDate is in date format to support previous versions. if (isset($syncedDateArray[$mcStore]) && $syncedDateArray[$mcStore]) { diff --git a/app/code/local/HCG/MailChimp/Batch/Commerce/Send.php b/app/code/local/HCG/MailChimp/Batch/Commerce/Send.php index 57ca6b15c..9abc93fd7 100644 --- a/app/code/local/HCG/MailChimp/Batch/Commerce/Send.php +++ b/app/code/local/HCG/MailChimp/Batch/Commerce/Send.php @@ -17,7 +17,7 @@ final class Send { */ static function p(int $mgStore):void { $h = hcg_mc_h(); - $mcStore = hcg_mc_sid($mgStore); /** @var ?string $mcStore */ + $mcStore = hcg_mc_sid($mgStore); /** @var string $mcStore */ try { self::deleteUnsentItems(); if ($h->isEcomSyncDataEnabled($mgStore)) { diff --git a/app/code/local/HCG/MailChimp/Batch/GetResults.php b/app/code/local/HCG/MailChimp/Batch/GetResults.php index 36c609a0d..3237792c2 100644 --- a/app/code/local/HCG/MailChimp/Batch/GetResults.php +++ b/app/code/local/HCG/MailChimp/Batch/GetResults.php @@ -13,7 +13,7 @@ final class GetResults { */ static function p(int $mgStore, bool $isEcommerceData = true, string $status = H::BATCH_PENDING) { $h = hcg_mc_h(); - $mcStore = hcg_mc_sid($mgStore); /** @var ?string $mcStore */ + $mcStore = hcg_mc_sid($mgStore); /** @var string $mcStore */ $bc = new BC; /** @var BC $bc */ $bc->addFieldToFilter('status', ['eq' => $status]); if ($isEcommerceData) {