Skip to content

Commit

Permalink
https://github.com/thehcginstitute-com/m1/issues/580
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Apr 24, 2024
1 parent cd359b8 commit 46fb2a3
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions app/code/community/Ebizmarts/MailChimp/Model/Observer.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php
# 2024-04-24 Dmitrii Fediuk https://upwork.com/fl/mage2pro
# "Refactor `Ebizmarts_MailChimp_Model_Observer`": https://github.com/thehcginstitute-com/m1/issues/580
use Mage_Adminhtml_Block_Customer_Edit_Tabs as CustomerTabs;
use Mage_Customer_Model_Customer as C;
class Ebizmarts_MailChimp_Model_Observer {

const PRODUCT_IS_ENABLED = 1;
Expand Down Expand Up @@ -1089,33 +1087,6 @@ protected function createEmailCookie($subscriber)
}
}

/**
* 2024-04-24 Dmitrii Fediuk https://upwork.com/fl/mage2pro
* "Refactor the `Ebizmarts_MailChimp` module": https://github.com/thehcginstitute-com/m1/issues/524
* @used-by Mage_Core_Model_App::_callObserverMethod()
* @see app/code/community/Ebizmarts/MailChimp/etc/config.xml
*/
function addCustomerTab(Varien_Event_Observer $o):void {
// add tab in customer edit page
if (($b = $o->getEvent()->getBlock()) instanceof CustomerTabs) { /** @var CustomerTabs $b */
$c = Mage::getModel('customer/customer')->load(df_request('id')); /** @var C $c */
# 2024-04-24 Dmitrii Fediuk https://upwork.com/fl/mage2pro
# "Delete the `->getMailchimpStoreView()` / `mailchimp_store_view` calls for `Mage_Customer_Model_Customer`
# because it always returns `NULL`": https://github.com/thehcginstitute-com/m1/issues/578
if (hcg_mc_h()->getLocalInterestCategories((int)$c->getStoreId())
&& ($this->getRequest()->getActionName() == 'edit' || df_request('type'))
) {
$b->addTab(
'mailchimp', [
'label' => 'MailChimp',
'url' => $b->getUrl('adminhtml/mailchimp/index', ['_current' => true]),
'class' => 'ajax'
]
);
}
}
}

protected function getRequest()
{
return Mage::app()->getRequest();
Expand Down

0 comments on commit 46fb2a3

Please sign in to comment.