Skip to content

Commit

Permalink
https://github.com/thehcginstitute-com/m1/issues/641
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Jun 8, 2024
1 parent a0d7786 commit 8ae5318
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
8 changes: 0 additions & 8 deletions app/code/community/Ebizmarts/MailChimp/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -1400,14 +1400,6 @@ function addStoresToFilter($collection, $scopeId, $scope) {
return $collection;
}

/**
* 2024-06-08 Dmitrii Fediuk https://upwork.com/fl/mage2pro
* "Refactor the `Ebizmarts_MailChimp` module": https://github.com/thehcginstitute-com/m1/issues/524
* @used-by self::STUB()
* @return ?array(string => string|int)
*/
function getMailChimpScopeByStoreId(int $sid):?array {return hCfg::scopeByPathV(Cfg::GENERAL_MCSTOREID, hcg_mc_sid($sid));}

/**
* Return default store id for the configured scope on MailChimp.
*
Expand Down
15 changes: 13 additions & 2 deletions app/code/local/HCG/MailChimp/Cfg.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
namespace HCG\MailChimp;
use Ebizmarts_MailChimp_Model_Config as eC;
use Mage_Adminhtml_Block_System_Config_Form as F;
use Mage_Core_Model_Config_Data as C;
# 2024-06-08
Expand All @@ -24,8 +25,9 @@ static function isExtraEntry(C $c, string $s, int $sid, int $wid):bool {

/**
* 2024-06-08 Dmitrii Fediuk https://upwork.com/fl/mage2pro
* "Refactor the `Ebizmarts_MailChimp` module": https://github.com/thehcginstitute-com/m1/issues/524
* @used-by \Ebizmarts_MailChimp_Helper_Data::::getMailChimpScopeByStoreId()
* Transfer the configuration code from `Ebizmarts_MailChimp_Helper_Data`
* to a dedicated class (`HCG\MailChimp\Cfg`) and `hcg_mc_cfg_*` functions: https://github.com/thehcginstitute-com/m1/issues/641
* @used-by self::scopeByStoreId()
* @used-by \Ebizmarts_MailChimp_Helper_Data::getApiByMailChimpStoreId()
* @used-by \HCG\MailChimp\Tags\ProcessMergeFields::_addSubscriberData()
* @return ?array(string => string|int)
Expand All @@ -46,4 +48,13 @@ static function scopeByPathV(string $p, string $v):?array {return
!($d = df_fetch_one('core_config_data', '*', ['path' => $p, 'value' => $v]))
? null : ['scope_id' => (int)dfa($d, 'scope_id'), 'scope' => dfa($d, 'scope')]
;}

/**
* 2024-06-08 Dmitrii Fediuk https://upwork.com/fl/mage2pro
* Transfer the configuration code from `Ebizmarts_MailChimp_Helper_Data`
* to a dedicated class (`HCG\MailChimp\Cfg`) and `hcg_mc_cfg_*` functions: https://github.com/thehcginstitute-com/m1/issues/641
* @used-by self::STUB()
* @return ?array(string => string|int)
*/
static function scopeByStoreId(int $sid):?array {return self::scopeByPathV(eC::GENERAL_MCSTOREID, hcg_mc_sid($sid));}
}

0 comments on commit 8ae5318

Please sign in to comment.