Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save supercleanse/9896419 to your computer and use it in GitHub Desktop.
Save supercleanse/9896419 to your computer and use it in GitHub Desktop.
Get active product subscriptions for the current user
<?php
$user = MeprUtils::get_currentuserinfo();
// Alternatively you can just create a user from a user id directly
// $user = new MeprUser($user_id);
if( $user ) {
$active_product_ids = $user->active_product_subscriptions();
// Alternatively to get Product objects you could do this
// $active_product_objs = $user->active_product_subscriptions('products');
// Alternatively you can even get a list of the user's most current active transaction in the subscription
// $active_txn_objs = $user->active_product_subscriptions('transactions');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment