1

I work on a project that uses Lite API (https://www.amember.com/docs/API/Lite).

I have a page where users can add their content. I need to be able to determine users' subscription status, i.e. whether they have any active subscription, paid or free (not expired), when I view their content. Is it possible to use Lite API for that? If yes, if I know the user ID, how would I pass it into something like this:

if (Am_Lite::getInstance()->haveSubscriptions(Am_Lite::ANY)) {
  // has active subscription...
}

Thanks

santa
  • 12,234
  • 49
  • 155
  • 255
  • What have you tried? `haveSubscriptions($search) ` Seems $search is an array of Product IDs. I see [examples of doing what you are asking in their forums](http://www.amember.com/forum/threads/get-user-subscrption-information.17257/). Not feeling like copying and pasting. – ficuscr Jul 02 '19 at 17:15
  • Documentation expects the user to be logged in. All I have is the user ID. Can I pass it into to get results? – santa Jul 02 '19 at 17:43
  • Can you load a user instance by ID? Something like `/users?_key=[yourkey]&_filter[user_id]=123` Looks like you would just use `$user->getActiveProductIds()` at that point. Sorry I'm not helping more, no desire to read their docs. – ficuscr Jul 02 '19 at 17:48
  • @ficuscr No worries, appreciate your input. – santa Jul 02 '19 at 18:32

0 Answers0