$_item['product_id']
is a product id . We will find out categoryid associate with product.
$product = Mage::getModel('catalog/product')->load($_item['product_id']);
$cats = $product->getCategoryIds();
Now we have category ID(s). One product can associate with more then one categorys. This is Magento default nature.
foreach ($cats as $category_id) {
$_cat = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($category_id);
echo $_cat->getName();
}
$_cat->getName()
; is your product category name. This is beneficial if product is associate with a single category. if product is associate with multiple category then we need category ID to get product category name.
i hope this will little helpful for you