Sunshop: Get a product’s top parent category

If you do any custom development for Turnkey Webtools’ Sunshop shopping cart software, sooner or later you come across this challenge. Categories in Sunshop are organized very simply. Every sub-category has a parent category id (stored in the “subof”...