3

how can I import and export all categories in magento with csv format?

5 Answers 5

2

Mass Product Importer - Magmi Project

The magmi project initial goal was to provide a product mass import script from csv files that match magento dataflow csv export format.

The main project goal is to achieve dataflow like operations with a reasonable speed.

http://sourceforge.net/projects/magmi/

1

This forum post on the Magento website takes you through the process. It adds a new Adapter to import categories via the Magento importer. This is the recommended approach rather than using raw SQL due to the complex joins and indexes.

1

I dont know about exporting it.I only know how to import it. To importing category: 1. Create Advanced Profile and paste the code written by santosh kumar from this forum http://www.magentocommerce.com/boards/viewthread/26022/ and save it.

  1. I get blank admin page while running it,so need to modify dataflow.xml from adminhtml/default/default/layout/ <adminhtml_system_convert_profile_run> <remove name = "root"/> <block type="adminhtml/page" name="convert_root" output="toHtml" template="page.phtml"> <block type="adminhtml/page_head" name="convert_root_head" as="head" template="page/head.phtml"> <action method="addJs"><script>prototype/prototype.js</script></action> <action method="addJs"><script>prototype/validation.js</script></action> <action method="addJs"><script>varien/js.js</script></action> <action method="addJs"><script>mage/translate.js</script></action> <action method="addJs"><script>mage/adminhtml/tools.js</script></action> </block> <block type="adminhtml/system_convert_profile_run" name="system_convert_profile_run" template="system/convert/profile/process.phtml" output="toHtml"/> </block> </adminhtml_system_convert_profile_run> and flush magento cash, Now you can see profile executes. One more thing you need to create categories.csv in var/import folder and in which you have to write store,categories default,Sports default,Sports/Cricket default,Sports/Tenis.
3
  • store,categories in a new line theb default,Sports in a new line and continue for doing like this to add categories. Mar 1, 2011 at 14:27
  • AS i said its working only for importing,not for exporting!! Does it work for you? And do you know how to export it? Mar 4, 2011 at 5:12
  • Have Created? U got any solution for exporting? Jun 22, 2011 at 8:01
1

I used Magmi for Mass products import products it is good for fast products import but there are many issues we have to fix it to make it work. Now i am looking for Import Export Categories code but i am unable to find it then i got Import Export Categories extension,http://www.magentocommerce.com/magento-connect/import-export-categories-extension.html It works great. Easy to install and work as per my requirements. fully satisfied.

0

The following code works for me. Please check the following link for full code. https://www.pearlbells.co.uk/export-woocommerce-categories-csv/

function getCategories() {
wp_reset_query();
$custom_terms = get_terms('product_cat');
$allData = array();
foreach( $custom_terms as $custom_term ) {

    $categoryData = array( $custom_term->term_id, $custom_term->parent, $custom_term->name, $custom_term->slug, $custom_term->description  );
    $seoData = yoastSeoDetails( $custom_term->term_id );
    $featuredImage = getCategoryImage( $custom_term->term_id  );
    $allData[$custom_term->term_id] = array_merge( $categoryData, $seoData, $featuredImage );
}
createCSV($allData);
}

function getCategoryImage( $catId ) {

$thumbnail_id = get_woocommerce_term_meta( $catId, 'thumbnail_id', true ); 
$catImageUrl = wp_get_attachment_url( $thumbnail_id );    
return array($catImageUrl);

}

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.