1. I wonder how expire happens. Does it happen automatically based on time even if there is no action on web site (something like cron) or only if an user try to access any content. Is there any description about the mechanism of expiration and renew of subscription. How should I test this behavior in my plugin.
I ask because I need to use Membership Pro for software license manager based on subscription. I develop my own plugin to handle license keys and their expiration on onMembershipActive() and onMembershipExpire() events.
2. I wonder what should I test if I need to know actual expiry date for the plan.
Is it enought to get expire from main plan
Code:
$query->clear()
->select('plan_id, user_id, plan_subscription_status, plan_subscription_to_date')
->from('#__osmembership_subscribers')
->where('plan_main_record = 1')
->where('user_id = ' . $row->user_id);
$db->setQuery($query);
$rowFields = $db->loadObjectList();
foreach ($rowFields as $rowField)
{
$expire = $rowField->plan_subscription_to_date;
}