Showing posts with label Get ID. Show all posts
Showing posts with label Get ID. Show all posts

December 19, 2013

Magento Get the customer session Id

Mage::getSingleton('customer/session')->getId()


or

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

     $user = Mage::getSingleton('customer/session')->getCustomer();

     echo $user->getId();

}