Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do you get the current guest customer? 
 
seedeg
Sr. Member
 
Total Posts:  85
Joined:  2009-02-02
 

Hi,

For some reasons which aren’t important, my shop only lets you check our as a guest. Upon success, meaning at success.phtml, I need to send another seperate email with some other details. Therefore I need to get the current e-mail address and preferably even the name so I can send the e-mail from success.phtml. I read the forums and I learned how you get the current logged in customer but of course this doesn’t work for me since there aren’t any customers.

I think that since there are only guests checkout, the names are not stored in the database but they are still stored in a session because if not, the default e-mail with order confirmation cannot be sent. How can i get this variable?

Thanks and regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
mightyjohn
Jr. Member
 
Total Posts:  12
Joined:  2009-05-20
 

I’d like to know this too. Where can i get the guest email addresses?

 
Magento Community Magento Community
Magento Community
Magento Community
 
seedeg
Sr. Member
 
Total Posts:  85
Joined:  2009-02-02
 

Hi.

I did manage to find the solution for this.

Open app/design/frontend/default/’your-template’/template/checkout/success.phtml

Then paste the following code:

$_customerId Mage::getSingleton('customer/session')->getCustomerId();
    
$customer Mage::getSingleton('customer/session')->getCustomer();
    
$lastOrderId Mage::getSingleton('checkout/session')->getLastOrderId();
    
$order Mage::getSingleton('sales/order');
    
$order->load($lastOrderId);
    
$_totalData $order->getData();
    
$_details $customer->getData();

    
$email $_totalData['customer_email'];   //Retrieves guest e-mail
    
$name $order->getBillingAddress()->getName();    //Retrieves guest name

Hope this helps smile

Regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
squirrels
Sr. Member
 
Total Posts:  93
Joined:  2008-08-27
 

Hi,
I’m also interested in this, I have the same problem, only guests are shopping from my shop. They are also sending a lot of e-mails, is there any way I could retrieve the addresses from the mails and orders I already got (without copying and pasting from each and every order/e-mail)?

Would be extremely great! smile

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