I need to be able to get the Category name and ID from a product and I am able to retrieve the ID doing the following:
$categoryID = $product->getCategoryCollection()->getFirstItem()->getId();
However If I try to get the name, It always returns null.
$categoryName = $product->getCategoryCollection()->getFirstItem()->getName();
How do I get the name?
I have tried loading the Category by ID but that seems to be returning null as well, I have checked in the admin screen the correct ID for the category is returned.