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

Core API Order Creation—Not passing through Guest’s email to order
 
bradleyfeldman
Jr. Member
 
Total Posts:  1
Joined:  2011-10-08
 

I’m using 1.5.1.0 and the Core API (xmlrpc) to create orders via the shopping cart. 

While I can fully create a guest user, shipping and billing address, add items/options to the cart, select a shipping and billing method, and create the order, the guest user’s email address information is not making it all the way through to the order.

In other words, it IS NOT being populated in sales_flat_order (as customer_email). However, the guest’s name IS being populated in the order as customer_firstname and customer_lastname.

During the cart process, just before creating the order, I issue a cart.order call.  The response from that call shows the email address populated in several places.

Is there a bug in the Shopping Cart portion of the Core API?

Any thoughts?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mcp3000
Jr. Member
 
Total Posts:  5
Joined:  2011-12-19
 

i’m having the same problem, did you find a solution for this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
davidsmith90
Member
 
Avatar
Total Posts:  37
Joined:  2011-10-12
 

This may not be answer that you are looking for but couldn’t you upgrade to the latest version of Magento to see if it fixes your problem?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mcp3000
Jr. Member
 
Total Posts:  5
Joined:  2011-12-19
 

i’m running magento 1.6.1 - the problem still exists. any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mcp3000
Jr. Member
 
Total Posts:  5
Joined:  2011-12-19
 

the email adress is lost in

Mage_Checkout_Model_Api_Resource_Customer

in method

_prepareGuestQuote

Original Code

protected function _prepareGuestQuote(Mage_Sales_Model_Quote $quote)
    
{
        $quote
->setCustomerId(null)
            ->
setCustomerEmail($quote->getBillingAddress()->getEmail())
            ->
setCustomerIsGuest(true)
            ->
setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
        return 
$this;
    
}

there is no email adress set for the billing adress so i changed it to

protected function _prepareGuestQuote(Mage_Sales_Model_Quote $quote)
    
{    
        $quote
->setCustomerId(null)
            ->
setCustomerEmail($quote->getCustomerEmail())
            ->
setCustomerIsGuest(true)
            ->
setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
        return 
$this;
    
}

of course this is a modification of a core file, so make sure you apply this change update safe!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Thundar
Jr. Member
 
Total Posts:  7
Joined:  2010-10-13
 

Thank you, this worked for me!

I suggest you to copy /app/code/core/Mage/Checkout/Model/Api/Resource/Customer.php into /app/code/local/Mage/Checkout/Model/Api/Resource/Customer.php and edit the file in local, so that you can apply a backup just deleting the new file, and your edit will not be rewritten from Magento updates.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gurukeerthi G
Jr. Member
 
Total Posts:  4
Joined:  2011-08-12
 

For me customer’s email id also missed for guest users. Can anyone know how to get the customer email id through API.

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