I'm using Magento1.9.3.8 and I want to include customer id/entity_id of a customer in CSV from exporting customer data (System > Import/Export > Export > Customers). right now I'm only getting this:

Attached the screen shot :

enter image description here

  • Hello @Jojo, Did you checked my answer? Is it helpful for you or not? – Rohit Feb 20 at 4:24

You can add customer_id(entity_id) in export CSV using following way :

You just simply add entity_id field in $validAttrCodes array in following file:


You can change in public function export() function.

 public function export()
     $collection = $this->_prepareEntityCollection(Mage::getResourceModel('customer/customer_collection'));
     $validAttrCodes = $this->_getExportAttrCodes();
     array_unshift($validAttrCodes, "entity_id"); //Add Customer Id(entity_id) field.
     $writer = $this->getWriter();

You can override /app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php file in your custom module.

enter image description here

I hope it will helpful for you.

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.