2

When I get an order from PayPal Express the customer name in the confirmation mail is always "Guest". I checked the mail template and there it says {{htmlescape var=$order.getCustomerName()}}.

I tried calling this from normal code like this:

$n = Mage::getModel('sales/order')->load($id)->getCustomerName();
var_dump($n);

This also returns "Guest" for the Express order. How is it possible to get the real name for a PayPal Express order, just like for the other orders with different payment methods?

1
  • Same issue in Magento 2 Jun 25, 2021 at 6:15

1 Answer 1

7

If user name not show in admin when place an order with paypal express as guest.

Please find below file and replace code(For best practice override Mage_Paypal_Model_Express_Checkout class): app/code/core/Mage/Paypal/Model/Express/Checkout.php

protected function _prepareGuestQuote()
{
    $quote = $this->_quote;
    $quote->setCustomerId(null)
        ->setCustomerFirstname($quote->getBillingAddress()->getFirstname()) 
        ->setCustomerLastname($quote->getBillingAddress()->getLastname())
        ->setCustomerEmail($quote->getBillingAddress()->getEmail())
        ->setCustomerIsGuest(true)
        ->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
    return $this;
}

reference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.