0

I have done this script to runs data/profile using ssh terminal to export csv data of all products inside of magento 1.9. I need to have the category name (structure tree) instead of category Ids but i do not know how to do that. Attached my code.

<?php
#$profileId = 1; #All Products
$profileId = 49; #OnSale
require_once 'app/Mage.php';
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$profile = Mage::getModel('dataflow/profile');
$userModel = Mage::getModel('admin/user');
$userModel->setUserId(0);
Mage::getSingleton('admin/session')->setUser($userModel);
$profile->load($profileId);
if (!$profile->getId()) {
 Mage::getSingleton('adminhtml/session')->addError('[ERROR] Invalid ID');
}
Mage::register('current_convert_profile', $profile);
$profile->run();
$recordCount = 0;
?>

1 Answer 1

0

I solve the problem, check out my solution. To export category name instead of category Ids, you should unparse the file app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php by copy and replace this lines (around at 402 line)

https://gist.github.com/scgoeswild/272dce1dbb5d620ee8b922408fcc6a82#gistcomment-3528471

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.