Skip to content

Commit

Permalink
https://github.com/thehcginstitute-com/m1/issues/572
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Apr 22, 2024
1 parent 67408cb commit 9dc6309
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/code/community/Ebizmarts/MailChimp/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions app/code/community/Ebizmarts/MailChimp/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/code/local/HCG/MailChimp/Batch/Commerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/local/HCG/MailChimp/Batch/Commerce/Send.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/local/HCG/MailChimp/Batch/GetResults.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9dc6309

Please sign in to comment.