This has been a real problem for me, I've been trying to figure it out for two days. I want to be able to have a user log into a page, then I'll look up what products/subscriptions expired. Then I'll offer them a renewal. But it I just haven't been able to find a way to find expired products/subscriptions. Seems like amember will email about subscriptions, but I'm not seeing any way to programmatically find out what subscriptions are expired. If it's expired, both $_SESSION['_amember_products'] and $_SESSION['_amember_subscriptions'] are empty. So I end up with nothing to work with. Any pointers?
Both these session vars will not have expired products. You should use MySQL database to query users expired payments : Code: include "config.inc.php"; $q = $db->query("select * from amember_payments where completed =1 and member_id ='".$_SESSION["_amember_id"]."' and begin_date<=now() and expire_date <=now()"); while($payment = mysql_fetch_assoc($q)){ $payment['data'] = unserialize($payment['data']); $expired[] = $payment; } So $expired will have only expired payments for this user.