Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › eStore – Custom php Report for Users Membership Levels with Expiry Date
- This topic has 4 replies, 3 voices, and was last updated 8 years, 3 months ago by admin.
-
AuthorPosts
-
June 12, 2016 at 2:12 am #13526lcallanderMember
I’m trying to create a PHP report so that we can catch users before their membership expires.
Right now, I’ve got the code showing only the user and email, and having difficulty pulling in the primary membership level and expiration date.
Here’s what I have:
<body>
<?php
// Get all users order by amount of posts
$allUsers = get_users(‘orderby=user_login=ASC’);
$users = array();
// Remove admins from the list as they don’t buy anything
foreach($allUsers as $currentUser)
{
if(!in_array( ‘ignoreme’, $currentUser->roles ))
{
$users[] = $currentUser;
}
}
?>
<section class=”content” >
<table>
<thead>
<tr><th width=”75px”>USER</th>
<th width=”125px”>EMAIL</th>
<th width=”125px”>PRIMARY LEVEL</th>
<th width=”125px”>EXPIRATION</th>
</tr>
</thead>
<?php
foreach($users as $user)
{
?>
<tr>
<td><p><?php echo $user->display_name; ?></p></td>
<td><p><?php echo $user->user_email; ?></p></td>
<td><p><?php echo $user->user_membership_level_name; ?></p></td>
<td><p><?php echo $user->member_expiry_date; ?></p></td>
</tr>
<?php
}
?>
</table>
</section>
</body>
June 12, 2016 at 8:17 am #73379adminKeymasterHave you checked the following resources which tells you how to retrieve details of a member?
How to Retrieve and Show Specific Details of the Logged-in Member
https://www.tipsandtricks-hq.com/wordpress-membership/wp-emember-miscellaneous-tweaks-248
July 29, 2016 at 9:20 pm #73380lcallanderMemberUnfortunately, those are only great for displaying a single member at a time. I need a report.
July 29, 2016 at 10:03 pm #73381wzpModeratorUnfortunately, those are only great for displaying a single member at a time. I need a report.
FOR I = 1 TO HIGHEST_USER_ID
NEXT I
Custom programming assistance is available:
July 30, 2016 at 6:05 am #73382adminKeymasterHave you checked the following option in the plugin’s admin interface?
WP eMember -> Members -> Member Lists -> Display Soon to Expire Member List
That option produces a list with all the members that are about to expire withing a given timeframe and their expiry data.
-
AuthorPosts
- You must be logged in to reply to this topic.