we generate a list of $categoryIds
like below. The problem is that it also returns some Ids that do not exist in the current store.
$categoryIds = Mage::registry('current_product')->getCategoryIds();
if (!empty($categoryIds)) {
$categoryId = current($categoryIds);
Question: Now how can I solve this with low overhead. To me it seems like there are two methods.
Filter the complete $categoryIds collection and keep only members of current store? (something like: getting all categories from the store and sift out the ones that exisst on both stores)
Check the single categoryId from current, and shift to the next value if it does not exist? (something like: check if it can be loaded with a store_id and if not continue)
Reference, not completely similar