Created
March 31, 2014 16:37
-
-
Save supercleanse/9896419 to your computer and use it in GitHub Desktop.
Get active product subscriptions for the current user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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