Jump to content

Customer Name Transposed in PayPal [1.4.0.8]


Recommended Posts

Got the PayPal interface working...really easy...works like a charm, except: The customer's name appears in PayPal as first = last, last = first. In other words, when John Smith completes an order, he appears in PayPal as Mr. Smith John.

Has anybody seen that before? I'm going to dig through the PayPal module, but I thought I'd give the forums a shot as well. When we find a solution, it would be important to share anyway.

Link to comment
Share on other sites

I haven't had a chance to look into latest version of Paypal module, but I guess this issue is only display format because of different country culture, not first/last name data switched. If you go to see detail in Paypal data, I guess the first name and last name should be correct.

Link to comment
Share on other sites

I think I found the code in the PayPal module, and it appends the name as lastname + firstname and sends it to PayPal. The order details in PayPal are all showing the data as LastName FirstName. So, I end up with Mr. John Smith in my store and Mr. Smith John in PayPal. I understand it could be a country/culture issue, but it would be nice if it was consistent.

I am going to test changing the code in the module. If it works like I think it will, I'll stick with customization. Not sure if it warrants a bug report, but maybe a feature request for some formatting flexibility would be in order.

Link to comment
Share on other sites

This is what I have uncovered. There are 3 php files within the PayPal modules that concatenate the name as "lastname" + "firstname" as it prepares to send it to PayPal. I made the following changes to the files, and the name in PayPal is now listed as "firstname" + "lastname"

/modules/paypal/paypal.php
Before:

ln 388            $requestAddress = '&SHIPTONAME;='.urlencode($address->company.' '.$address->lastname.' '.$address->firstname)...



After:

ln 388            $requestAddress = '&SHIPTONAME;='.urlencode($address->company.' '.$address->firstname.' '.$address->lastname)...



/modules/paypal/express/paypalexpress.php
Before:

ln 68              $request .= '&SHIPTONAME;='.urlencode($address->lastname.' '.$address->firstname);



After:

ln 68              $request .= '&SHIPTONAME;='.urlencode($address->firstname.' '.$address->lastname);



/modules/paypal/payment/paypalpayment.php
Before:

ln 66            $request .= '&SHIPTONAME;='.urlencode($address->lastname.' '.$address->firstname);



After:

ln 66            $request .= '&SHIPTONAME;='.urlencode($address->firstname.' '.$address->lastname);



The difference can be seen in the highlighted portions of the attached screenshots. My [spam-filter] thinks I'm picking nits on this one, since she doesn't think the customers will see it. But, I see it, so it matters ;-)

37165_kX8shTRgdKxfyp8tZOF1_t

37166_TEo2qf6vr2tNCaFzqOpj_t

Link to comment
Share on other sites

In my testing, I also noticed the transposition on the shopping-cart.tpl page during the 5-page checkout. It occurs on the summary step in the Delivery and Invoice Addresses. It appears correct (first name first) later in the process on the Address step under the delivery and billing addresses.

/themes/prestashop<or your theme>/shopping-cart.tpl
Before:

ln 292              {$delivery->lastname|escape:'htmlall':'UTF-8'} {$delivery->firstname|escape:'htmlall':'UTF-8'}

ln 303                {$invoice->firstname|escape:'htmlall':'UTF-8'} {$invoice->lastname|escape:'htmlall':'UTF-8'}



After:

ln 292              {$delivery->lastname|escape:'htmlall':'UTF-8'} {$delivery->firstname|escape:'htmlall':'UTF-8'}

ln 303                {$invoice->firstname|escape:'htmlall':'UTF-8'} {$invoice->lastname|escape:'htmlall':'UTF-8'}



Again, I use the terms "right" and "wrong" in the context of consistency. If last name first suits you, you may want to find the code where it displays first name first and change it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...