Page 1 of 1

Automatically Upgrade Member

PostPosted: June 24th, 2011, 3:07 pm
by DigitalMcGrath
I am not offering a free membership, instead I want to offer level 1 for free for a period of 3 days and then automatically upgrade the user to level 2. Any idea how I can accomplish this?

Re: Automatically Upgrade Member

PostPosted: June 24th, 2011, 5:09 pm
by DigitalMcGrath
I managed to get this to work using the s2member register link hack.

Re: Automatically Upgrade Member

PostPosted: June 24th, 2011, 5:57 pm
by Cristián Lávaque
I'm glad you got it working. :)

What hack do you mean? Could you post a link to it? I'm sure others will find this information helfpul.

Re: Automatically Upgrade Member

PostPosted: June 25th, 2011, 9:25 am
by DigitalMcGrath
I used this:

Code: Select all
add_action("init", "register_level");
function register_level(){
    if(isset($_GET["register_level"])){
        $link = c_ws_plugin__s2member_register_access::register_link_gen ("none", "-", $_SERVER["HTTP_HOST"], "1:2D", false);
        wp_redirect($link); exit();
    }
}   


But as of right now it's not working correctly. It is registering users as a "Free Subscriber" and not "Level 1".

Re: Automatically Upgrade Member

PostPosted: June 25th, 2011, 1:51 pm
by Cristián Lávaque
Did you get it from here? viewtopic.php?f=36&t=2819

I'll ask Jason about it.

Re: Automatically Upgrade Member

PostPosted: June 25th, 2011, 6:57 pm
by Jason Caldwell
I think the problem here is with the documentation that I wrote on this before. I mentioned that you should use a dash "-" if there was no transaction. That's bad advice, because each User must be associated with a unique Subscr. ID, even if there was no transaction. I'm updating the original thread now. Instead of using a dash, please use time() instead. Sorry for the confusion.

For instance, please try this:
Code: Select all
add_action("init", "register_level");
function register_level(){
    if(isset($_GET["register_level"])){
        $link = c_ws_plugin__s2member_register_access::register_link_gen ("n/a", time(), $_SERVER["HTTP_HOST"], "1:2D", false);
        wp_redirect($link); exit();
    }
}