Redirect to link after payment ( plugin ? )

More
10 years 8 months ago - 10 years 8 months ago #43641 by jad3z
Hey Tuan!

I want to thank you for the custom plugin example you gave me last time!
I still cant get it to work, can you check my code?
Code:
<?php /** * @version 1.0.0 * @package Joomla * @subpackage OS Membership Plugins * @author Tuan Pham Ngoc * @copyright Copyright (C) 2012-2014 Ossolution Team * @license GNU/GPL, see LICENSE.php */ define( '_JEXEC', 1 ); define( 'JPATH_BASE', dirname(__FILE__) ); define( 'DS', '/' ); defined( '_JEXEC' ) or die ; $hits = 5000; $channelName = ''; $user = JFactory::getUser(); $user_file = $user->username . '.ini'; $hits_dir = JPATH_BASE . DS . "hits/"; class plgOSMembershipScript extends JPlugin { public function __construct(& $subject, $config) { parent::__construct($subject, $config); } /** * Run when a subscription record stored into database (before payment is processed) * @param PlanOsMembership $row */ function onAfterStoreSubscription($row) { //Put the code you want to run after the subscription record is stored in database } /** * Run when a membership activated * @param PlanOsMembership $row */ function onMembershipActive($row) { if(file_exists($hits_dir.$user_file)) { $hits_ini = parse_ini_file($hits_dir.$user_file); } if(isset($hits_ini)) { $hits += $hits_ini['hits']; $channelName = $hits_ini['channel']; } $data = "[Configuration file]\r\n"; $data .= "hits=" . $hits . "\r\n"; $data .= "channel=" . $channelName; file_put_contents($hits_dir.$user_file, $data, LOCK_EX); } }
This little code writes a configuration file with the joomla user name.

How can i implent this so it doesnt use this plugin on every subscription plan





Like the usergroup plugin, its only used on that subscription if you actually make a selection.

PS :
$amount = 5000

I hope you can help me out, if it does i can open my site and buy the payment plugins!
Last edit: 10 years 8 months ago by jad3z.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #43656 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Almost there Tuan! Custom plugin for specific plan
Hi

I am sorry but customize code meet individual customer need is not in scope of our support. I can only guide you, but I could not read the code to understand what you want to do and write a plugin for you.

So you will have to write the code yourself and ask me any questions you have. I can only guide you how, not actually write the code for you.

If you don't Joomla programming, I am afraid of you will have to find a developer to help you.

Tuan

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #43662 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Almost there Tuan! Custom plugin for specific plan
A quick look at your code see something with your code :
Code:
if(file_exists($hits_dir.$user_file)) { $hits_ini = parse_ini_file($hits_dir.$user_file); }

Before that code is run, the $hits_dir and $user_file variables are not defined anywhere, so I believe the code is not correct.

Tuan

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago - 10 years 8 months ago #43663 by jad3z
Thanks for the response, is there a way we can work something out with a good price?

Or any solution how i can make people get redirected to my custom link for some plans ?
Something like ?
Code:
header('Location: http://www.example.com/script.php');

All plans redirect to subscription complete, custom redirect in the component doesnt work :(
Last edit: 10 years 8 months ago by jad3z.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #43710 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Almost there Tuan! Custom plugin for specific plan
Hi

What payment plugin you are using ? I believe when you add/edit the plan, you can see and enter the "Subscription complete url ". If you enter a url into that field when users completed the subscription, he will be redirected to that URL. I think that should solve your issue.

Tuan

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #43718 by jad3z
Paypal, and it doesnt worked :(
It just redirect to "Complete page"
Tested on joomla 2.5, 3.0 and 3.2

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #43719 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Almost there Tuan! Custom plugin for specific plan
What version of Membership Pro you are using ?
The following user(s) said Thank You: jad3z

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #43721 by jad3z
Membership Pro version 1.6.2, Copyright (C) 2012-2013 Ossolution Team

PS : Do you accept custom plugin offers? I will PM you.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #43722 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Almost there Tuan! Custom plugin for specific plan
Please get this file, unzip it, then upload to components/com_osmembership/plugins folder and check it again !

Regards,

Tuan
Attachments:

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #43723 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Almost there Tuan! Custom plugin for specific plan
Not ready for custom plugins offer at this time because right now, I want to spend my full time to finish new release of Membership Pro first.

Tuan

Please Log in or Create an account to join the conversation.