I was struggling to export Customer ID (entity_id) for some time. I thought it should be straight forward. But it wasn't, so after googling for a while I found this solution.
solution 1:
Override file: app\code\core\Mage\Customer\Model\Convert\Parser\Customer.php
and update function unparse();
previous:
$systemFields = array(); foreach ($this->getFields() as $code=>$node) { if ($node->is('system')) { $systemFields[] = $code; } }
after update:
foreach ($this->getFields() as $code=>$node) { if ($node->is('system') && strpos('entity_id',$code)===false) { $systemFields[] = $code; } }
solution 2:
override file: app\code\core\Mage\Customer\etc\config.xml
previous:
<entity_id><system>1</system><ignore>1</ignore></entity_id>
after update:
<entity_id><!--<system>1</system>--><ignore>1</ignore></entity_id>
solution 3:
But, i did this way:
create file: app\code\community\Technooze\Customer\etc\config.xml
and add this code:
<?xml version="1.0"?> <config> <modules> <Technooze_Customer> <version>1.0.0</version> </Technooze_Customer> </modules> <global> <models> <class>Technooze_Customer_Model</class> <customer> <rewrite> <convert_parser_customer>Technooze_Customer_Model_Convert_Parser_Customer</convert_parser_customer> </rewrite> </customer> </models> </global> </config>
Create file: app\code\community\Technooze\Customer\Model\Convert\Parser\Customer.php
and add this code:
<?php /* * updated to print out customer ID. */ class Technooze_Customer_Model_Convert_Parser_Customer extends Mage_Customer_Model_Convert_Parser_Customer { public function getFields() { if (!$this->_fields) { $this->_fields = Mage::getConfig()->getFieldset('customer_dataflow', 'admin'); } if(isset($this->_fields->entity_id)) { $this->_fields->entity_id->system=0; } return $this->_fields; } }
Now: create file: Technooze_All.xml if you don't already have.
and add this code:
<?xml version="1.0"?> <config> <modules> <Technooze_Customer> <active>true</active> <codePool>community</codePool> </Technooze_Customer> </modules> </config>
Which solution do you prefer? Please post your comment below plus like and follow us.
Bach Chien posted on - Tuesday 13th of March 2012 11:19:47 PM
Joshua posted on - Thursday 27th of June 2013 10:37:17 PM
Raffaele posted on - Wednesday 11th of December 2013 07:40:57 AM
Ma ora mi devo creare un nuovo profilo avanzato?
grazie mille
mike posted on - Tuesday 10th of February 2015 03:59:13 AM
Saravanan posted on - Tuesday 24th of February 2015 01:38:08 AM
john moljin posted on - Friday 15th of January 2016 03:06:58 AM
Sarah posted on - Wednesday 19th of August 2015 01:10:42 AM