Skip to content
This repository has been archived by the owner on Jun 1, 2018. It is now read-only.

Commit

Permalink
Merge branch 'santisp_dev' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiagoebizmarts committed Nov 18, 2016
2 parents 23611dc + 203464e commit 61cbb3d
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions app/code/community/Ebizmarts/MageMonkey/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,7 @@ public function updateCustomer(Varien_Event_Observer $observer)
$isAdmin = $request->getActionName() == 'save' && $request->getControllerName() == 'customer' && $request->getModuleName() == (string)Mage::getConfig()->getNode('admin/routers/adminhtml/args/frontName');
$customer = $observer->getEvent()->getCustomer();
$isCheckout = $request->getControllerName() == 'sales_order_create' || $request->getModuleName() == 'firecheckout' || $request->getModuleName() == 'checkout' || $request->getModuleName() == 'sgps' || Mage::getSingleton('core/session')->getIsOneStepCheckout() || Mage::getSingleton('core/session')->getMonkeyCheckout();
// $isConfirmNeed = FALSE;
// if (!Mage::helper('monkey')->isAdmin() &&
// (Mage::getStoreConfig(Mage_Newsletter_Model_Subscriber::XML_PATH_CONFIRMATION_FLAG, $customer->getStoreId()) == 1)
// ) {
// $isConfirmNeed = TRUE;
// }

if (!$isCheckout) {
$oldEmail = $customer->getOrigData('email');
$email = $customer->getEmail();
Expand Down Expand Up @@ -333,23 +328,6 @@ public function updateCustomer(Varien_Event_Observer $observer)
$api->listUpdateMember($listId, $oldEmail, $mergeVars, '', false);
}
}

//subscribe to MailChimp when customer subscribed from admin
//unsubscribe from Magento when customer unsubscribed from admin
// if ($isAdmin) {
// if ($subscriber->getStatus() == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED && !$customer->getData('is_subscribed')) {
// $subscriber->setImportMode(TRUE)->unsubscribe();
// Mage::getSingleton('monkey/api', array('store' => $customer->getStoreId()))->listUnsubscribe($defaultList, $customer->getEmail());
// } else {
// if($customer->getData('is_subscribed')) {
// Mage::getModel('newsletter/subscriber')
// ->setSubscriberEmail($customer->getEmail())
// ->setStoreId($customer->getStoreId())
// ->setImportMode(TRUE)
// ->subscribe($customer->getEmail());
// }
// }
// }
Mage::getSingleton('core/session')->setIsUpdateCustomer(FALSE);
}
}
Expand Down

0 comments on commit 61cbb3d

Please sign in to comment.