Magento – Associate Products to Categories after Export CSV

categoryconfigurable-productexportimportmagento-1.7

Is there a way to associate products with categories?

I've exported a csv with all the products, images etc (a complete export) then after the import (it wasn't painless) I've noticed 3 things

1) Categories was missing! Removed the products. Uploaded a csv with the categories. Uploaded, again, products but they still not in categories!!!

Do you know a way I can associate those products with categories?

Possibly with a csv? I've tried this (changing it a bit) and read other stuff on the net but no luck.

2) Configurable products are not associated, different colors and sizes products are there but not associated with the main product… (didn't fixed it yet)

3) Images was missing in Back & Frond end. fixed. (it wasn't painless)

Best Answer

To associate products with categories in Dataflow you'll need two pieces of data:

  • Sku (Configurable, Simple, doesn't matter)
  • The target Category IDs

The field for the category IDs needs to be comma-separated itself, so make sure it's quoted if you're manually creating it:

sku,category_ids
ABCD1234,"1,2,3,4,5"
L0S7,"4,8,15,16,23,42"

Save it to disk as a .csv file, and you can upload it to the All Products Import default dataflow profile. This will replace all current categories for the skus listed, so take caution and make sure to get a list of pre-existing category associations.