By Kirill Pilipenko on Wednesday, 14 March 2018
Posted in General Issues
Likes 0
Views 1K
Votes 0
How do I call plans in PHP (or Java)?

Yeah I know, users can create their own div wrapper around playplans (https://stackideas.com/docs/payplans/administrators/customizations/pricingpage).

But I'm looking for a way to call already generated Payplans.
You have them in Menu by link :

index.php?option=com_payplans&view=plan&task=subscribe&plan_id=0&group_id=0


So I tried

<?php
$FileContents = file_get_contents("*your domain*/index.php?option=com_payplans&view=plan&task=subscribe&plan_id=0&group_id=0");
echo $FileContents();
?>


It does work but also gives me footer and menu, because I call for a whole page. =)
There should be an easier way to call them same way menu does...?
Do you mean you would like to generate a subscription link?

If yes, you can use this way :



// Your custom plan id
$planId = 20;

echo XiRoute::_('index.php?option=com_payplans&view=plan&task=subscribe&plan_id=' . $planId);
·
Wednesday, 14 March 2018 11:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Arlex, I mean generate plans. Like my link above will lead you to page with a group of plans, but I also looking for a way to display certain plans.

So what I'm saying, I need a way to call my subscription plans or group of plans on any page with php or java...
·
Wednesday, 14 March 2018 11:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Actually i still a little bit lost here, do you want to display this specific plan on the certain page (screenshot : http://take.ms/9CNhj )?

Or you would like to create a subscription link display as the menu?

Based on what i check, it seems like there do not have easier way to generate specific plan on the page.

How the system render the current subscription plan listing page is :

1. This file JoomlaFolder/components/com_payplans/templates/default/plan/default.php is display all the single subscription plan and the group plan on this page (/index.php?option=com_payplans&view=plan&task=subscribe)

2. This file JoomlaFolder/components/com_payplans/templates/default/plan/default_plan.php is suppose to style the single subscription plan.

3. This file JoomlaFolder/components/com_payplans/templates/default/plan/default_group.php is suppose to style the group subscription plan,
·
Wednesday, 14 March 2018 16:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Arlex,
let's make a simple example - on my website by address "/plans/group/1" I have this

So this are 3 plans inside one of my groups. I need a way to call exactly this 3 plans on different pages including EasySocial with php.

Yes again, I can make a copy of it with HTML and just copy BUT it's not gonna be up to date from PayPlans admin section, and each time I change something I have to change this HTML as well.So I don't want this pain.

Tell me please how do I call this plans in PHP?
·
Thursday, 15 March 2018 00:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Unfortunately that was no any easier way to call this in the existing code.

Basically this is how it retrieve the subscription plan data under the specific group and following file location is how it render on the theme file in currently:


$groupId = 1;
$queryFilters = array('published'=>1, 'visible'=>1 );

$model = XiFactory::getInstance('plan','model');
$plans = $model->getGrouppedPlans($queryFilters, $groupId);
var_dump($plans);


JoomlaFolder/components/com_payplans/views/plan/view.html.php
JoomlaFolder/components/com_payplans/templates/tmpl_bs3/plan/default.php (bootstrap 3.x)
JoomlaFolder/components/com_payplans/templates/tmpl_bs3/plan/default_plan.php (bootstrap 3.x)
·
Thursday, 15 March 2018 16:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok got you. Thanks!
·
Saturday, 17 March 2018 01:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for understand.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.
·
Saturday, 17 March 2018 09:59
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post