I have 2 products in a product category, and I want to give this category access to a protected file ONLY IF the user is subscribed to BOTH products in that category. Not just 1 of them. How can this be done? I'm willing to do some code hacks or sql hacks if neccessary but will need help.
Hack would be needed., although maybe you can test putting protection on a subdirectory. eg protect /1/ with product 1, then /1/2/ with product 2 and maybe you can only get into /2/ if you have both 1 and 2. (untested) David
David, I am afraid this solution would not work. You can do PHP check for this, using either LITE API, REST API, or full aMember API. Sample with Lite Api: PHP: require_once 'amember/library/Am/Lite.php';$liteApi = Am_Lite::getInstance();if ($liteApi->haveSubscriptions(9) && $liteApi->haveSubscriptions(11)){ echo "You have access to both product 9 and product 11";} else { die("No Access to either product 9 or product 11!");}
Think you can do this too to make it easier? $check= array(1,2,3,4,5) $liteApi->haveSubscriptions($check) David
David, That will return true if user have subscription to any product included in array. Code with was suggested by Alex should be used if user must have both subscriptions.