View Full Version : need help about subscripation
Psyd0x
01-07-2015, 11:51 AM
I made a 2 upgrade packages in subscripation but i want to make
something like if the user bought the first package then he can upgrade to second package
can i do somethingl like this?
HM666
01-07-2015, 01:43 PM
What exactly do you mean by "upgrade". Do you mean the usergroup would change, they would get more perks etc? You can set up two subscriptions, but it depends on what functionality you need that pertains to the upgrade.
Psyd0x
01-07-2015, 03:50 PM
yes the usergroup would change if someone bought a package
there is a way to make a subscripation package for only usergroups that i choice?
Edit: actually, I was wrong. If you go to Subscription Permissions, you can set which usergroups are allowed to use a given subscription. Then all you need to do is make your second subscription available only to one usergroup, then add taht usergroup when someone buys the first one.
HM666
01-07-2015, 05:47 PM
Yes what Kevin said. :)
ozzy47
01-07-2015, 10:53 PM
I have not used Paid Subscriptions, but let me throw this out there.
Lets say a user is a member of group A.
Now he/she purchases the first tier subscription (in January), and gets promoted to usergroup B. This subscription is for one year.
Then 4 months later (May) he/she purchases the second tier, thus promoting them to usergroup C. This subscription is for one year also.
Now what happens next January when the first tier subscription runs out? is he/she demoted back to usergroup A? Or does he/she stay in usergroup C until May? If so what usergroup does the user get out back to? To my understanding of the system, ti would put him/her back into B, as that is the group they were in when they purchased the subscription.
HM666
01-07-2015, 11:03 PM
For all intents and purposes I believe it keeps them in group C. So they would have the subscription until t the last one they purchased ran out.
ozzy47
01-07-2015, 11:06 PM
Ok so what happens when it runs out, what group do they go to?
HM666
01-07-2015, 11:07 PM
Usually they go back to the registered users group. There are also mods on here that will alert them to let them know the subscription is about to run out so you get them to pay again without missing anything.
ozzy47
01-07-2015, 11:09 PM
I don't think so, if I am not mistaken they go back to their previous group. Think about it, if a admin bought a subscription, and it made then a super admin, when the subscription runs out, they would then become a registered user?
HM666
01-07-2015, 11:11 PM
Yeah true I'm thinking they started off in the registered user group because that is where I always directed my subscriptions to when i had them on the site. I'm ok :) Yeah they go back to whatever group they were before hand.
That's a good point, but if you add secondary groups instead of (or in addition to) changing the primary one I don't think it would be a problem. Anyway, it would be a good idea to run a test before setting it up.
ozzy47
01-07-2015, 11:16 PM
Right, that is what I am saying, If I was in group A, bought a tier one subscription, it moves me to group B. Now I purchase a tier two subscription, it moves me to group C.
So I see one of two thing that are going to happen
1) When the tier one subscription runs out, it will move me back to group A.
2) If the above does not happen, then when the tier two subscription runs out, I get moved back to B.
That makes me purchasing a tier two subscription a lifetime member of group B, because the tier two subscription over rode my group, that I came from.
HM666
01-07-2015, 11:42 PM
Wow that made me dizzy lol. I guess as Kevin said the only way to know for sure is to try it out and see what happens.
ozzy47
01-07-2015, 11:44 PM
This is what happens when a subscription is going to run out.
An email is sent to the subscriber 3 days before expiry via the Subscriptions Scheduled Task. Provided that's running OK, then the emails will be generated.
At expiry, the same scheduled task removes users from any usergroups that they were moved/added to when they took out the subscription and puts them back where they were.
HM666
01-08-2015, 05:26 AM
That is what I said above lol. They go back to the usergroup they started in before they did the subscription. ....don't they? lol
Wow that made me dizzy lol. I guess as Kevin said the only way to know for sure is to try it out and see what happens.
Well, I don't know if I'd go that far, but it certainly seems like it would be a good idea to test after setting it up and make sure it works as expected. But to each his own. Some people prefer to wing it and just hope there aren't any problems.
ozzy47
01-08-2015, 03:22 PM
That's true Kevin, but when I do something, I don't think as a developer, I think as a end user. I try to thing of all the possibilities that something might do something that I would not want, or would not expect it to do.
Now I suppose you could write up some code, that if I was to purchase the tier two subscription, when it is verified, update my tied one subscription to expire one day after the tier two subscription. That way the tier two expires, I go from group C back to group B, then a day later, I go back to group A.
Actually, I was just looking at the delete_user_subscription() function, and it looks like if the user's primary group is not the same one that was set by that (expiring) subscripton, then the primary usergroup isn't changed. There is some other logic, in that function and the build_user_subscription(), having to do with checking other active subscriptions before setting the usergroup, but I haven't worked it all out yet.
ETA: The answer seems to be (if everything is based on changing primary usergroups) that if you buy a tier 2 subscription after buying a tier 1, when tier 1 expires the user will stay in tier 2, then when tier 2 expires you will go back to tier 1 (and as Ozzy pointed out, it appears that it would be permanent unless some other arrangement is made to change it). So, like I said a few posts ago, if you use secondary groups to add the permissions, that should sidestep the issue. And as always, I recommend testing out whatever system you set up to make sure it works as you expect.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.