How to get current customer id in Magento.?

To get the Current customer id in Magento you can use the following code to get the desired result.

if(Mage::getSingleton('customer/session')->isLoggedIn()) {
     $customerData = Mage::getSingleton('customer/session')->getCustomer();
      echo $customerData->getId();
 }

 


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *