PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Can Access Levels be set via script? (ie., without payments)

s2Member Plugin. A Membership plugin for WordPress®.

Can Access Levels be set via script? (ie., without payments)

Postby dougR » February 8th, 2011, 6:57 pm

I have a need to use s2member in a "non-monetary" mode, meaning that I want to use the convenient access level controls of 0, 1, 2, 3, and 4, but do not want to require any form of payment/monetary transaction for a user to achieve a certain access level. Instead, I want access to be set based on their entry of an invitation code that I would provide select users (clients that we are engaged with thru other channels, who we would allow to receive premium content as a perk). This invitation code could be entered by the user at registration or later by entering it into a special invitation code field in their profile, for example. I envision creating a script that checks for invitation codes in their profile field, and then sets the official s2member access level accordingly (there would be one or more unique codes per level). Then, they would have access to all content set for that level, and all lower levels, just as s2member is intended to work. The problem is, I have found no mention of being able to set the access levels for a user through php scripts (without the need for a paypal or some other payment transaction).

Can this be done? There would seem to be a need for this by people like me, but I'm amazed that I've found no one asking this... Again, I am not so concerned about how to set up/check invitation code entries ( I know that can be done via existing features and scripts), but rather how can I set a user to a certain access level directly via PHP?

Thanks in advance for any insights...

Doug
User avatar
dougR
Registered User
Registered User
 
Posts: 3
Joined: February 8, 2011

Re: Can Access Levels be set via script? (ie., without payme

Postby stowe39 » February 15th, 2011, 9:04 pm

Setting up free registrations with different levels is detailed in the thread http://www.primothemes.com/forums/viewtopic.php?f=4&t=934 (the second post shows how to implement it.)

Perhaps you could email them a direct link that enabled them to get the membership level you want them to have.... sure they could forward on the email and let other ppl sign up too, but they could do that with a code as well.

Cheers

Kym
User avatar
stowe39
Registered User
Registered User
 
Posts: 22
Joined: February 15, 2011

Re: Can Access Levels be set via script? (ie., without payme

Postby dougR » February 17th, 2011, 1:13 pm

Kym,

Many thanks for pointing out that post. My prior searches had been focused on "access level" and somehow that post didn't come to my attention. I think that link-based approach could be a viable workaround method for me if I can find no other way.

I am still holding out hope that s2member provides some sort of hook to allow direct "setting" of access level via my own scripted logic, as that would open up so many more customization possibilities, like my invitation code concept. It's almost as if this is not supported by design, as some sort of access level integrity/protection philosophy... Aside from that reasoning, it seems like it would be such an obvious feature to want to provide, given that the value of the plugin is centered on use of these access levels.

- Doug
User avatar
dougR
Registered User
Registered User
 
Posts: 3
Joined: February 8, 2011

Re: Can Access Levels be set via script? (ie., without payme

Postby stowe39 » February 17th, 2011, 6:14 pm

Hi Doug

S2Member Pro supports coupon codes.... among the other extra capabilities.

I'm not sure if it will do what you want because I only have the free version.

*****Huge disclaimer - the ideas below this line are only a theory - and are dependent on your own coding ability/time/persistence******

you may be able to code a form that allows a member to enter a code that would triger the upgrade of their membership level.

From my understanding, the info in the forum post I linked to earlier is the equivalent to the $link that would come back from paypal after someone has purchased a subrcription (and it's encrypted which makes it a bit harder to debug)

So if you had a "please enter your code here" type form that checked the code was valid and returned the $link, it should upgrade your member's level.

**********

Of course - if the Pro version can do what you want, it would be a lot easier and quicker to buy it, instead of swearing at code :)

Cheers

Kym
User avatar
stowe39
Registered User
Registered User
 
Posts: 22
Joined: February 15, 2011

Re: Can Access Levels be set via script? (ie., without payme

Postby dougR » February 17th, 2011, 6:32 pm

Kym,

Your form theory sounds interesting... I'll have to look into that.. thanks!

I did read a bit about coupon codes... as I recall, they don't quite fit the bill because they only work by reducing a paypal amount by x, but the remaining amount owed still has to be more than 0, I think.
User avatar
dougR
Registered User
Registered User
 
Posts: 3
Joined: February 8, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron