I installed a free extension that requires admin approval before a customer can log in. I am hacking it to try to get it to allow all customer groups except for one. I think the following is the function that I would edit, but when I do a test registration the test cookie does not show up in my console. Any ideas?
/**
* Flag new accounts as such
*
* @param Varien_Event_Observer $observer
*/
public function customerSaveBefore($observer)
{
$customer = $observer->getEvent()->getCustomer();
$storeId = Mage::helper('customeractivation')->getCustomerStoreId($customer);
$session = Mage::getSingleton('customer/session'); // var $session Mage_Customer_Model_Session
$customer_info = $session->getCustomer(); // var $customer Mage_Customer_Model_Customer
$userinfo = $customer_info->_origData; // fetch users info
// get user's customer group id number
$customer_group = $userinfo['group_id'];
setcookie("Group", "yes");
if (Mage::getStoreConfig(self::XML_PATH_MODULE_DISABLED, $storeId))
{
return;
}
if (!$customer->getId())
{
$defaultStatus = Mage::getStoreConfig(self::XML_PATH_DEFAULT_STATUS, $storeId);
$customer->setCustomerActivated($defaultStatus);
$customer->setCustomerActivationNewAccount(true);
}
}
My code is the:
$customer_info = $session->getCustomer(); // var $customer Mage_Customer_Model_Customer
$userinfo = $customer_info->_origData; // fetch users info
// get user's customer group id number
$customer_group = $userinfo['group_id'];
setcookie("Group", "yes");