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();

}

No comments:

Post a Comment