Try the Demo

Magento Forum

   
Retrieve Customer ID in custom module
 
vcutting
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2007-10-25
Grimsby, UK
 

I’m fairly new to customizing Magento, but I’m trying to make a custom module for a store I’m building.

How do i echo the logged in customer’s ID in my module?
Ive tried using the following from the customer/account module but with no result:

<?php echo $this->__('Hello, %s!'$this->htmlEscape($this->getCustomerName())) ?>

 Signature 

VC Web Designs - Complete solutions for individuals and small businesses.

 
Magento Community Magento Community
Magento Community
Magento Community
 
swissters
Member
 
Total Posts:  31
Joined:  2008-04-23
 

Bump

This seems like it should be fairly easy for someone who knows magento.  Any help?

 Signature 

Eco-Friendly Custom Screen Printing and Web Design:
RenderedClothing.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
S4370PL
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2010-01-24
 

Any update in how to retrieve the customer info to the dashboard?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jignesh Chauhan
Sr. Member
 
Total Posts:  170
Joined:  2009-12-23
 

Hello,

Please Try this code.

$customerId=Mage::getSingleton(’customer/session’)->getCustomerId();
$customerName = Mage::getModel(’customer/customer’)->load($customerId)->getName();

Thanks and Regards,

Jignesh Chauhan

 Signature 

Thanks and Regards,
Jignesh Chauhan
Skype : er.jignesh.chauhan

 
Magento Community Magento Community
Magento Community
Magento Community
 
S4370PL
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2010-01-24
 

Thank you Jignesh for your reply

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top