In magento "Customer Grid", data in "Name" column is missing in some rows and showing in some rows. How can I fix to show data in "Name" column in all records? enter image description here

  • make sure on that record there is data are present – Keyul Shah Aug 31 '14 at 14:39
  • in customer detail page, last name is missing. All the records that miss last name in customer detail page do not show data in Name column. How can I proceed to retrieve last name in detail page. The problem is that last name is presented in some and not presented in some also. – Po Po Naing Aug 31 '14 at 14:53

Magento customer name in Customer grid is depends on addNameToSelect function on class Mage_Customer_Model_Resource_Customer_Collection. So,they may create issue on

1)on function addNameToSelect this field value comes with concatenate with prefix+firstname+middlename+lastname+suffix. logic

a)prefix(optional depends on setting )
c)middlenameoptional depends on setting )
e)suffix(optional depends on setting )

it may be issue with this.

2) database issue in some data.

Alternative Solution:

show first name and last name in individual columns.

step1:Just copy app\code\core\Mage\Adminhtml\Block\Customer\Grid.php to Copy this file to app\code\local\Mage\Adminhtml\Block\Customer\Grid.php.

Step2: on _prepareColumns just add code below code:

$this->addColumn('firstname', array(
        'header'    => Mage::helper('customer')->__('First Name'),
        'index'     => 'firstname'
    $this->addColumn('lastname', array(
        'header'    => Mage::helper('customer')->__('Last Name'),
        'index'     => 'lastname'
| improve this answer | |
  • But I would like to show only "Name" column. I do not want to show individual columns of first name and last name. The problem why "Name" data is missing is that data in "Last Name" field is missing in customer detail page. – Po Po Naing Aug 31 '14 at 15:03
  • magento must throw error if customer did not have last name.it may some customization on your system – Amit Bera Aug 31 '14 at 15:07
  • if you want to show it on grid then copy app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php to app/code/loal/Mage/Customer/Model/Resource/Customer/Collection.php just commit $concatenate[] = 'LTRIM(RTRIM({{lastname}}))'; – Amit Bera Aug 31 '14 at 15:09
  • In customer registration, customers put their first name and last name and then click "Save". Registration is successful but in "Customer detail page of Customer grid", last name is missing. How can I control to this problem? Thank you so much for giving me your time Amit Bera. – Po Po Naing Aug 31 '14 at 15:10
  • then.... check system.log and exception log where actual issue for not saving last name in db.put this code question – Amit Bera Aug 31 '14 at 15:14

i have the same problem. About 2 months ago i imported 130 customers and today trying to import but the Name in Customer Grid column is missing. I tried to add manually but still not working. Really strange that on old customers Names are there and on this no. Can you somebody help? see screenshotenter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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