Pages

Monday 22 December 2014

Magento:: Custom Login Logout With Email Address

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

   <a href="<?php echo Mage::helper('customer')->getLoginUrl(); ?>" title="Log In" class="login"><?php echo $this->__('Log In') ?></a>
<?php else: ?>
   <a href="<?php echo Mage::helper('customer')->getLogoutUrl(); ?>" title="Log Out" class="login"><?php echo $this->__('Log Out') ?></a>
    <?php endif; ?>
2- For Email Address.

<div class="email">
  <?php  $customer = Mage::getSingleton('customer/session')->getCustomer();
     $customerData = Mage::getModel('customer/customer')->load($customer->getId())->getData();
     $email = $customerData['email'];
     echo $email;
   ?>
</div>

No comments:

Post a Comment