-
Frontend Login form.
Hi There,
I have search almost everywhere, and I can't fine how to force a customer to login. I only want registered customers to be able to see and access my shopping site (members only!). I want a blank page with only a login form, How do I do that? :confused:
Will appreciate your help!
Br.
Hanan
-
In your magento module, you can use this code to check if current user is logged in
Code:
if (Mage::app()->isInstalled() && Mage::getSingleton('customer/session')->isLoggedIn()) {
echo Mage::getSingleton('customer/session')->getCustomer()->getName();
}
And get current user information
Code:
$customer_data = Mage::getSingleton('customer/session')->getCustomer();
echo "<pre>" print_r($customer_data);
Then what you need is if user is not logged in you redirect to login URL. Your code will not check if the URL is login URL or register URL.
-