I'm modifying a plugin that currently checks if the user is subscribed to a particular product id. We want to change that to check for a product category instead. My current code to get the products is this: $user = Am_Di::getInstance()->userTable->getAuthenticatedRow($login, $pass, $code); $prodIds = $user->getActiveProductIds(); I can't find a similar functionality to get categories. Is there an easy way to do this? Thanks in advance.
1. Query for all products in category: PHP: // return array { category_id => [product_id1, product_id2, ...] } $products = Am_Di::getInstance()->productCategoryTable->getCategoryProducts(); 2. Then get products for user: PHP: $prodIds = $user->getActiveProductIds(); and compare both arrays: PHP: array_intersect($prodIds, $products[$category_id])