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™

100% Custom Registration page with s2member integration

s2Member Plugin. A Membership plugin for WordPress®.

100% Custom Registration page with s2member integration

Postby geekz » September 9th, 2010, 4:13 pm

Hello.
Thanks for the cool plugin. Please help me for this small problem.


I have created a custom registration page template.
I have used wordpress wp_create_user :oops: function to do this.
Here is a snippet :
Code: Select all
$myuser_id = wp_create_user( $uname, $password, $remail );
update_user_meta( $myuser_id, 'first_name', $fname);
update_user_meta( $myuser_id, 'last_name', $lname);
update_user_meta( $myuser_id, 'city', $city);
update_user_meta( $myuser_id, 'gender', $gender);
update_user_meta( $myuser_id, 'age', $age);


Requirements OF membership :
1.free member
2. Paid member

A user can be a paid member only after he registers as a free member.

So , now my doubts :?: are ,
1. if i set open register to yes, What will be the default user_role :? and how can i assign it dynamically in the form.
2. if a user registers as a free member and later pays through a generated paypal member button, will his userrole change to the required one automatically?



Waiting for reply from an expert..... :roll:
User avatar
geekz
Registered User
Registered User
 
Posts: 7
Joined: September 9, 2010

Re: 100% Custom Registration page with s2member integration

Postby Jason Caldwell » September 9th, 2010, 10:48 pm

Hi there. Thanks for the great questions.
1. if i set open register to yes, What will be the default user_role :? and how can i assign it dynamically in the form.

The default Role during a non-paid registration is Subscriber ( aka: Level #0 ). So if a public visitor registers for free, they go in as a Free Subscriber at Level #0. If you would like to change this, you could do something like this in your own custom routine:

Code: Select all
$new_user_id = wp_create_user( $uname, $password, $remail );
$new_user = new WP_User($new_user_id);
$new_user->set_role("s2member_level1"); 

Here are the different Role IDs.
Code: Select all
administrator
editor
author
contributor
subscriber
s2member_level1
s2member_level2
s2member_level3
s2member_level4

2. if a user registers as a free member and later pays through a generated paypal member button, will his userrole change to the required one automatically?

Yes, s2Member will handle this automatically.
Their Role will be updated automatically after checkout, and they'll be asked to log back in again.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: 100% Custom Registration page with s2member integration

Postby geekz » September 12th, 2010, 5:13 pm

:D Thanks a lot for the quick reply Jason.
I didnt expected such a fast response. Thanks..

I have another small question.

Requirements :
    1. There will be two registration forms.
    2. First registration form is for free members and can be accessed by anyone.
    3. Second registration form is for paid members and can be accessed only after making the payment through the paypal generated button.


Question
I am unable to make the second type of registration form.
I want the users to reach the registration page or be able to see the registration page only after they make payment for the membership using the paypal button. Is there a way to do this???


Waiting for reply .... :roll:
User avatar
geekz
Registered User
Registered User
 
Posts: 7
Joined: September 9, 2010

Re: 100% Custom Registration page with s2member integration

Postby bluecafe » September 13th, 2010, 6:27 am

If you set up a paypal button with the specific member level that is available against payment the user should be redirected to the relevant registration page I think.
User avatar
bluecafe
Registered User
Registered User
 
Posts: 17
Joined: September 13, 2010

Re: 100% Custom Registration page with s2member integration

Postby geekz » September 13th, 2010, 10:52 am

But i already have a custom registration page.
I want to create another for paid members and only after successful paypal transaction they can see this registration page.

Still Unresolved Problem :



Requirements :

    1. There will be two registration forms.

    2. First registration form is for free members and can be accessed by anyone.

    3. Second registration form is for paid members and can be accessed only after making the payment through the paypal generated button.



Question
I am unable to make the second type of registration form.
I want the users to reach the registration page or be able to see the registration page only after they make payment for the membership using the paypal button. Is there a way to do this???
User avatar
geekz
Registered User
Registered User
 
Posts: 7
Joined: September 9, 2010

Re: 100% Custom Registration page with s2member integration

Postby Jason Caldwell » September 29th, 2010, 2:24 pm

Hi there. Thanks for the great question.

Yes, please turn Open Registration: off
s2Member -> General Options -> Open Registration

Then, all you need to do is check register access before displaying your custom form.
Code: Select all
if(ws_plugin__s2member_check_register_access()){
    // display form
} 
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: 100% Custom Registration page with s2member integration

Postby go4sachin007 » March 4th, 2011, 7:38 am

I just wanna put my point please help and thanks in advance

I have installed s2member plugin and i have rquirement like as goes
I want two user type one is user which is default subscriber and free and
other user type is publishers which must be s2member_level1 and also free

so for subscriber the url run as http://example.com/wp-login.php?action=register
and for s2member_level1 some page runs and in this i called a template for my custome coding in which we can put the code for the registering member.
url goes for it as http://example.com/membership/
through this code viewer goes to paypal BUT i dont want like this I want that if a customer comes in this link, then a simple registration form open with customised fields that i set in setting for s2member_level1 and registered in database as s2member_level1 user.

Is this possible and if possible than please help via code


If somebody understand what i want to say then please help


regards
sachin
User avatar
go4sachin007
Registered User
Registered User
 
Posts: 1
Joined: March 4, 2011

Re: 100% Custom Registration page with s2member integration

Postby Sayhellotoryan » August 11th, 2011, 4:08 pm

go4sachin007 wrote:I just wanna put my point please help and thanks in advance

I have installed s2member plugin and i have rquirement like as goes
I want two user type one is user which is default subscriber and free and
other user type is publishers which must be s2member_level1 and also free

so for subscriber the url run as http://example.com/wp-login.php?action=register
and for s2member_level1 some page runs and in this i called a template for my custome coding in which we can put the code for the registering member.
url goes for it as http://example.com/membership/
through this code viewer goes to paypal BUT i dont want like this I want that if a customer comes in this link, then a simple registration form open with customised fields that i set in setting for s2member_level1 and registered in database as s2member_level1 user.

Is this possible and if possible than please help via code


If somebody understand what i want to say then please help


regards
sachin


Hi did you ever figure out how to do this?
User avatar
Sayhellotoryan
Registered User
Registered User
 
Posts: 5
Joined: August 11, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron