Reputation: 14514
How do I check if a user is signed in?
Like:
<?php unless user_is_signed_in
echo "Please log in"
end
?>
Upvotes: 0
Views: 1256
Reputation: 10114
Mage::getSingleton('customer/session')->isLoggedIn();
or
Mage::helper('customer')->isLoggedIn();
The second method calls the first - see here
So using the helper method as an example...
$isLoggedIn = Mage::helper('customer')->isLoggedIn();
if (! $isLoggedIn) {
echo "Please log in";
}
Upvotes: 2