Question

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

Was it helpful?

Solution

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:

/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top