I have to develop module and as a part of it, I have to create custom product export profile but I'm not sure how to reach this step.
I find code like this so I could insert this to data-installer but it must be configurable: must have predefined map but it should let admin changes it, change format (csv/xls)
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$profile = Mage::getModel('dataflow/profile');
$data = array(
'name' => "Import affiliate Products Feed",
'actions_xml' => '<action type="dataflow/convert_adapter_io" method="load"><var name="type">file</var>
<var name="path">var/import</var>
<var name="filename"></var>
<var name="format"></var>
</action><action type="dataflow/convert_parser_csv" method="parse"><var name="delimiter"></var>
<var name="enclose"></var>
<var name="fieldnames">true</var>
<var name="store"></var>
<var name="number_of_records">1</var>
<var name="decimal_separator"></var>
<var name="adapter">catalog/convert_adapter_Product</var>
<var name="method">parse</var>
</action>'
);
if (isset($data)) {
$profile->addData($data);
}
try {
$profile->save();
} catch (Exception $e){
die($e->getMessage());
}
Is there any easy way to do this because code I found rather won't work even after rebuilding...
Other idea I have is to create custom link in admin menu and there build block with whole export settings and leave behind above code and standard magento export system but it will consume large amount of time.
Can someone give me some tips or have any idea how to resolve this?