Hi,
Would it be possible to have the exact context where you are using that $product variable ?
Depending how you access it and which variable it is exactly, the category might not be available (depending if it's just the product which has been loaded or the "full product").
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.