Monday, 28 January 2013

To check if a user is logged in or log out

<?php
if ($this->helper('customer')->isLoggedIn() ) {
    echo '<a href="<?php echo $this->getUrl('customer/account/login/');?>">Login</a>';
} else {
    echo '<a href="<?php echo $this->getUrl('customer/account/logout/');?>">Logout</a>';
}
?>

No comments:

Post a Comment