Import products with multiple categories

  • Hi I am importing products in my 1.7.0.2 new setup, I already added the categories. when i import the csv product file, all go well. But the problem is the product is added to only subcategory, it is not added to root category at the same time. If the subcategory and root category both are not checked in product edit page then product does not show on the front end. I want every product to be added to root and sub categories, I have tried it in many ways but have not succeeded yet. Below are some ways i have applied (3 is root category id and 13 is sub)

    _category,category_ids,_root_category
      Abc, 3|13, Root Catalog
    
    _category,category_ids,_root_category
      Abc, '3,13', Root Catalog
    
    _category,category_ids,_root_category
      Abc, 3/13, Root Catalog
    
    _category,_root_category
      Root Catalog/Abc, Root Catalog
    
    _category,_root_category
      Abc, Root Catalog
    

    even have applied them in single and double quotes as well.

    Any help would be very much appreciated.

  • philwinkle

    philwinkle Correct answer

    8 years ago

    Import using Magento's System > Import/Export > Dataflow Profiles. Make a comma-delimitted list of category_ids with sku as the key. Save it out as a CSV file:

    sku,category_ids
    ABC123,"1,2,3,4,5,7"
    A3K23,"7,8,6,5"
    

    When imported with Dataflow, the category_ids for the skus will be replaced with the categories as listed above so make sure you catch all of the categories otherwise their current assignment will be replaced with those uploaded.

    If you need store id-based categories use the following, where store is the store code:

    sku,store,category_ids
    ABC123,admin,"1,2,3,4,5,7"
    ABC123,store2,"100,200,300"
    

    thanks for the answer. how can i import multiple images of a single product? how can separate them in media gallery attribute in csv file? comma thing does not work there.

    No problem. That is a separate question and one I would be glad to answer if you would post it separately as it would exceed the scope of the comments section.

    What do you do if the category names have commas in them? Is there another separator that would work?

License under CC-BY-SA with attribution


Content dated before 7/24/2021 11:53 AM