User login after Admin approval in Magento 1.9
Admin need to approve the account before the users can browse the products and view the pricing for the products.
User login after Admin approval in Magento 1.9
Admin need to approve the account before the users can browse the products and view the pricing for the products.
You have two requirement :
First admin approval, for this use extension https://github.com/Vinai/customer-activation
And for second requirement to restrict user to login before browsing website, for this you have to create a custom module or can edit in existing custom module for this:
add event in config.xml :
...
<events>
<controller_action_predispatch>
<observers>
<restrictcustomers_controller_action_predispatch>
<class>Custom_Module_Model_Observer</class>
<method>restrictCustomer</method>
</restrictcustomers_controller_action_predispatch>
</observers>
</controller_action_predispatch>
</events>
...
In Model/Observer.php
:
public function restrictCustomer(Varien_Event_Observer $observer)
{
$action = strtolower(Mage::app()->getRequest()->getActionName());
$controller = strtolower(Mage::app()->getRequest()->getControllerName());
$openActions = array(
'index',
'create',
'createpost',
'login',
'loginpost',
'logoutsuccess',
'forgotpassword',
'forgotpasswordpost',
'resetpassword',
'resetpasswordpost',
'confirm',
'confirmation'
);
if (($controller == 'customer_account' || $controller == 'account') && in_array($action, $openActions)) {
return; //if in allowed actions do nothing.
}
if ($controller == 'index' && $action == 'loginpost')
{
return; //if in allowed actions do nothing.
}
if(! Mage::helper('customer')->isLoggedIn()){
Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('customer/account/login'));
}
else
{
return;
}
}
You can see this:
How to add a customer pre-approval module?
https://www.extensionhut.com/customer-approve-disapprove.html
http://www.magebright.com/magento-customer-approve-extension.html#
Hope this can help you.
By default, Customer approval functionality is not available in magento. You can use the community extension for customer approval functionality.
Here is one community extension available for this: https://github.com/Vinai/customer-activation
This functionality is not available with Magento by default. So you probably need to implement this using a module. Basically, what you need to do here is:
status
for the customer entity.Hence this is too broad to answer in a single answer. You can also look for some nice extension that does the same functionality. I recommend this extension.
I hope you can deal with this.