Product Export – How to Export Product Entity ID Using Dataflow

dataflowexportproduct

Magento does not let you choose to export entity_id (among other system fields) in the dataflow wizard.

How to get around this ?

Trying to work this out I searched around, found some sites, but could not work it out.

Decided to work it out myself. The answer follows.

Best Answer

Ok i did this on magento 1.6.2 (it may be different in your version, but likely not)

Firstly edit: app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php

find:

            if (in_array($field, $this->_systemFields) || is_object($value)) {
                continue;
            }

make it look like:

            if (in_array($field, $this->_systemFields) || is_object($value)) {
                if($field != "entity_id")continue;
            }

This allows the exporting of system field "entity_id". To then choose it to export you can either just choose to export all fields, or make the following edit to add "entity_id" to the drop downs of selectable fields:

Optionally Edit: app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php

find:

    array_splice($attributes, 0, 0, array(''=>$this->__('Choose an attribute')));

make it look like:

    $attributes["entity_id"] = "entity_id";
    array_splice($attributes, 0, 0, array(''=>$this->__('Choose an attribute')));

Done.

Related Topic