jcadima
8/11/2016 - 2:35 PM

Conditional to display only if customer is logged in

Conditional to display only if customer is logged in

https://stackoverflow.com/questions/21110345/how-to-add-logout-link-in-topmenu-in-header-section 

<?php

if( Mage::getSingleton('customer/session')->isLoggedIn())  {   ?>

  //not logged in
        
}

else{
  // logged in
}


=============================================

<?php if (Mage::helper('customer')->isLoggedIn() ): ?>
  <a href="<?php echo Mage::helper('customer')->getLogoutUrl(); ?>"><?php echo 'Log OUT'; ?></a>

  
    <?php/*
    else: ?>
            <a href="<?php echo Mage::helper('customer')->getLoginUrl(); ?>">SIGN IN</a>
        <?php 
    */  ?>
    
<?php endif; ?>