User names - Last then first - possible?

User names - Last then first - possible?



My users names are currently listed like this:



Jack Beanstalk

Jill Danger

John Doe



I can easily sort by first name but not by last name.



How do I sort like this?



Beanstalk, Jack

Danger, Jill

Doe, John

Is there a specific spot where it needs to be changed?

[quote name=‘TexasGuy’]Is there a specific spot where it needs to be changed?[/QUOTE]



Texas Guy,



Are you asking the same question that I am?



Or are you asking me a question?



If you are asking me then i want the ability to sort all users by last name which seems normal for the business world.



So normal and standard that I assume that I am not seeing something simple and obvious.

I was trying to understand where you have the users listed, on invoice, on the form, etc…

I am talking about the admin area where all the users are listed by default 2.014 has them by first name.



My invoices are correct - First name Last name

[quote name=‘Traveler’]I am talking about the admin area where all the users are listed by default 2.014 has them by first name.



My invoices are correct - First name Last name[/QUOTE]



Try this. I’m still setting up my site so I don’t have many test users to test on but I think this works.



Open the “skins/SKINNAME/admin/views/profiles/manage.tpl” file.



Change this code (Line 51 for me but I’ve made other changes and not sure if this is the true line by default):

```php

{if $user.firstname || $user.lastname}[COLOR="Red"]{$user.firstname} {$user.lastname}[/COLOR]{else}-{/if}
```

to be this:
```php
{if $user.firstname || $user.lastname}[COLOR="Red"]{if $user.lastname}{$user.lastname}, {/if}{$user.firstname}[/COLOR]{else}-{/if}
```

[quote name=‘Traveler’]I am talking about the admin area where all the users are listed by default 2.014 has them by first name.



My invoices are correct - First name Last name[/QUOTE]



Try this. I’m still setting up my site so I don’t have many test users to test on but I think this works.



Open the “skins/SKINNAME/admin/views/profiles/manage.tpl” file.



Change this code (Line 51 for me but I’ve made other changes and not sure if this is the true line by default):

```php

{if $user.firstname || $user.lastname}[COLOR="Red"]{$user.firstname} {$user.lastname}[/COLOR]{else}-{/if}
```

to be this:
```php
{if $user.firstname || $user.lastname}[COLOR="Red"]{if $user.lastname}{$user.lastname}, {/if}{$user.firstname}[/COLOR]{else}-{/if}
```

Then in the file "core/fn.users.php", change this code (in fn_get_users, line 632 for my file, again it has other mods):
```php
'name' => array([COLOR="Red"]"?:users.firstname", "?:users.lastname"[/COLOR]),
```

to this:
```php
'name' => array([COLOR="Red"]"?:users.lastname", "?:users.firstname"[/COLOR]),
```

Please test it with your user list and let me know of any issues.

Edit: I do notice that if something has no lastname, like a Supplier, then they are ranked separate.

Thank you for the code changes.



If no one has a simpler answer I shall try it.



Is it only me or do others think it strange to sort by first name instead of by last name?



Perhaps first names are used in Russia? I really do not know I am curious.

I have always found this a curious choice - it is like this in some other carts too.



On the other hand, I most often just type in the name if I am looking for a particular customer.



Bob

[quote name=‘jobosales’]I have always found this a curious choice - it is like this in some other carts too.



On the other hand, I most often just type in the name if I am looking for a particular customer.



Bob[/QUOTE]



It is OK as a choice but the standard business format should also be possible.



This is what I call a design bug although the developers would probably call it working as designed…

Oh, I agree it makes more sense to list and sort on last name - this would be my preference. I was just noting that some other shopping carts also behave this way (e.g., I know Magento used to sort on first name).



And, yes, it is working as designed so it needs to be addressed as a feature request.



Bob

[quote name=‘adodric’]Try this. I’m still setting up my site so I don’t have many test users to test on but I think this works.



Open the “skins/SKINNAME/admin/views/profiles/manage.tpl” file.



Change this code (Line 51 for me but I’ve made other changes and not sure if this is the true line by default):

```php

{if $user.firstname || $user.lastname}[COLOR=Red]{$user.firstname} {$user.lastname}[/COLOR]{else}-{/if}
```to be this:
```php
{if $user.firstname || $user.lastname}[COLOR=Red]{if $user.lastname}{$user.lastname}, {/if}{$user.firstname}[/COLOR]{else}-{/if}
```Then in the file "core/fn.users.php", change this code (in fn_get_users, line 632 for my file, again it has other mods):
```php
'name' => array([COLOR=Red]"?:users.firstname", "?:users.lastname"[/COLOR]),
```to this:
```php
'name' => array([COLOR=Red]"?:users.lastname", "?:users.firstname"[/COLOR]),
```Please test it with your user list and let me know of any issues.

Edit: I do notice that if something has no lastname, like a Supplier, then they are ranked separate.[/quote]

[B]Adodric,
[/B]
The line 632/633 code change is clear and a step in the right direction thank you. Now i have first name last name sorted by last name.

I would like last name, first name

Your profile line 51 change is not clear to me what does it do? and why is last name repeated more then once?

Thanks again!