Jump to content

How to display full first and last name in orders list


massycroft

Recommended Posts

Hi,

I need to make display full first name and full last name in the 'Customer' column present in the section Orders>Orders. Currently, as default it shows me abbreviated first name and full last name, e.g.= M. Jackson instead of Michael Jackson.

 

How can I do to get it?

 

Thank you very much in advance.

Max.

 

Link to comment
Share on other sites

Hi Massycroft,

 

You need to edit AdminOrdersController.php to accomplish this.

This file can be found in controllers -> admin -> AdminOrdersController.php

 

Change:

CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`,

to:

CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`,

Don't forget to empty your cache under Advanced parameters -> Performance.

  • Like 2
Link to comment
Share on other sites

  • 11 months later...
  • 2 years later...
  • 1 month later...
  • 1 year later...

Hello,

just a note for 1.7.7.x

search a lot time for find this :) almost all admin files chanced

src/Core/Grid/Query/OrderQueryBuilder.php

find

    private function getCustomerField()
    {
        return 'CONCAT(LEFT(cu.`firstname`, 1), \'. \', cu.`lastname`)';
    }

replace

    private function getCustomerField()
    {
        return 'CONCAT(cu.`firstname`, \'  \', cu.`lastname`)';
    }

bests...

  • Like 2
  • Thanks 3
Link to comment
Share on other sites

  • 11 months later...
  • 9 months later...
On 5/20/2022 at 1:04 PM, Skafander said:

Hello, solution of @safa works in 1.7.7.x but you are unable to search by full name and surname. Does anyone have a clue how to get it work?

I agree with the question, does anyone know how to make it searchable by firstname as well?

Link to comment
Share on other sites

  • 2 months later...
On 6/9/2021 at 4:38 AM, safa said:

Hello,

just a note for 1.7.7.x

search a lot time for find this :) almost all admin files chanced

src/Core/Grid/Query/OrderQueryBuilder.php

find

   Hi,

 
bonabanyo.jpg.e0bbb31020d30f6a6b155c692e502470.jpg

In the getCustomerField() method, I have modified the CONCAT function to limit the lastname field to 20 characters using the LEFT() function. This change ensures that long customer names won't affect your list by cutting off the displayed name to a specified character count.

Link to comment
Share on other sites

  • 1 year later...

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...