Magento setCategoryIds Invalid category IDs.

No matter what I was doing during my import I was getting errors on setCategoryIds. It didn’t matter if I gave it an array of ids or a string, it would always error out with the exception “Invalid category IDs.”.

I had a look at the actual function and decided to change how I set my category ids:

So now, I just use the last bit 😛
I create an array of Category Ids and set it with setData() and now all the categories are set :/

Seriously, Magento really pisses me off sometimes..

Leave a Reply