I am having some troubles getting all parent id's from a category id.
Imagine this category tree:
The easiest way to do so is this:
$category = Mage::getModel('catalog/category')->load($categoryId);
Each category has a field called
path that contains the ids of the parents and current category.
$path = $category->getPath();
This should return something like this
All you need to do is to split this string by
/ and remove the first element. That one is the id for 'root of all roots'.
$ids = explode('/', $path); unset($ids);
Now you should have what you are looking for in