Tuesday, 21 May 2013

Magento : Login/Logout Code in Header

<?php if (! Mage::getSingleton('customer/session')->isLoggedIn()): ?>

<a href="<?php echo Mage::helper('customer')->getLoginUrl(); ?>"><?php echo $this->__('Login') ?></a>

<?php else: ?>

<a href="<?php echo Mage::helper('customer')->getLogoutUrl(); ?>"><?php echo $this->__('Logout') ?></a>

<?php endif; ?>

No comments:

Post a Comment