Pramod T P

Search
Skip to content
  • Home
  • PHP
  • WordPress
  • Linux
  • Magento
  • My SQL
  • Profile
  • comments

Daily Archives: March 30, 2011

Magento

How to check if an user is logged in – Magento

March 30, 2011 Pramod T P Leave a comment
<?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>';
 }
?>
MagentoPHP
Magento

How to get the logged in user details on phtml page – Magento

March 30, 2011 Pramod T P 2 Comments
<?php 
 $customer = Mage::getSingleton('customer/session')->getCustomer();
 $email = $customer->getEmail();// for email address
 $firstname = $customer->getFirstname();//  For first name
 $lastnam e= $customer->getLastname();// For last name
?>
MagentoPHP

Zend | Magento Certified PHP | eCommerce Architect

For Latest Updates
Visit phpcodez.com

Categories

Recent Posts

  • Regular expression
  • preg_match
  • Redirect root domain to a subdomain .htaccess
  • Redirect root domain to a subfolder .htaccess
  • Force SSL htaccess
March 2011
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Feb   Apr »

Recent Comments

togel online's avatartogel online on How to terminate the current s…
business funding's avatarbusiness funding on compare two strings – ja…
unsecured loans uk's avatarunsecured loans uk on Function to add an element int…
treating back pain's avatartreating back pain on Submit HTML form to pop up pag…
Pura Cleanse's avatarPura Cleanse on Add the block "Based on y…
  • RSS - Posts
Blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • Pramod T P
    • Already have a WordPress.com account? Log in now.
    • Pramod T P
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar