By Manfred on Thursday, 15 March 2018
Posted in General Issues
Replies 1
Likes 0
Views 486
Votes 0
I am using the subscription detail app instance

https://stackideas.com/docs/payplans/administrators/essentials/subscription-detail

I have a select box here with a name of po_required which is either 1,2 or 3 as a value

I need to check this value in my pdfinvoice view so need to know how I can call this value from the database so I can do a PHP if statement based on the value of this field. As this is an app instance, I assume its not part of PayplansApi::getSubscription($id), so what can I use to call this value in my code.. if at all?

The data is stored in #_payplans_subscription.params
Based on what i check the existing code, it seems like it normally use this way to retrieve the current logged in user subscription params for all his current subscription plan.


// Your user id
$userId = 123;

$user = PayplansUser::getInstance($userId);

// contain active, expired subscription status
$allowedStatus = XiFactory::getConfig()->subscription_status;
$subscriptionRecords = array();

if (!empty($allowedStatus)){
$filter = array('user_id' => $userId , 'status' =>array(array('IN', '('.implode(",", $allowedStatus).')')));
$subscriptionRecords = XiFactory::getInstance('subscription','model')->loadRecords($filter, array('limit'));
}

·
Friday, 16 March 2018 12:12
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post