- Posts: 14
- Thank you received: 0
Redirect to link after payment ( plugin ? )
- jad3z
- Topic Author
- Offline
- New Member
Less
More
10 years 8 months ago - 10 years 8 months ago #43641
by jad3z
Redirect to link after payment ( plugin ? ) was created 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?
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!
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);
}
}
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.
- Tuan Pham Ngoc
- Offline
- Administrator
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
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.
- Tuan Pham Ngoc
- Offline
- Administrator
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 :
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
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.
- jad3z
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
10 years 8 months ago - 10 years 8 months ago #43663
by jad3z
Replied by jad3z on topic Almost there Tuan! Custom plugin for specific plan
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 ?
All plans redirect to subscription complete, custom redirect in the component doesnt work
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.
- Tuan Pham Ngoc
- Offline
- Administrator
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
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.
- jad3z
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
10 years 8 months ago #43718
by jad3z
Replied by jad3z on topic Almost there Tuan! Custom plugin for specific plan
Paypal, and it doesnt worked
It just redirect to "Complete page"
Tested on joomla 2.5, 3.0 and 3.2
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.
- Tuan Pham Ngoc
- Offline
- Administrator
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.
- jad3z
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
10 years 8 months ago #43721
by jad3z
Replied by jad3z on topic Almost there Tuan! Custom plugin for specific plan
Membership Pro version 1.6.2, Copyright (C) 2012-2013 Ossolution Team
PS : Do you accept custom plugin offers? I will PM you.
PS : Do you accept custom plugin offers? I will PM you.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
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
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
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
Tuan
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.