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™

Auto Fill Registration Form

s2Member Plugin. A Membership plugin for WordPress®.

Auto Fill Registration Form

Postby dwbiz05 » March 17th, 2011, 3:52 pm

I couldn't find anything through the search, so hopefully I'm not repeating anyone.

I'm looking for some way to auto-fill some of the registration form inputs with the user's information being sent from PayPal.

Is there any way to do this quickly? If not, anyone know what files I would need to "adjust" to add this functionality myself? Most of my customers will not want to fill in all their information twice and I would like to not make them if possible.

Thanks in advance for the help!

Dave
User avatar
dwbiz05
Registered User
Registered User
 
Posts: 11
Joined: March 17, 2011

Re: Auto Fill Registration Form

Postby dwbiz05 » March 18th, 2011, 10:52 am

OR...

Is there a way to have them fill out the registration form before going to paypal?

Problem is that I still don't want people to be able to sign up as free users... :)

I'm only asking for the moon... lol!

Dave
User avatar
dwbiz05
Registered User
Registered User
 
Posts: 11
Joined: March 17, 2011

Re: Auto Fill Registration Form

Postby Jason Caldwell » March 18th, 2011, 11:39 pm

Hi Dave. Thanks for the excellent question.

By default, s2Member will send a Customer directly to PayPal®, and only after checkout is completed does the Customer have the ability to register a Username/Password for access to your site. This process works very well in most cases, and it has the benefit of increasing conversion rates; because there are fewer obstacles for the Customer on their way to the actual checkout process at PayPal®.

That being said, we believe the "ideal" approach is a combined Checkout/Registration process; in just one simple step ( available with s2Member Pro via PayPal® Pro integration ). Also works with Authorize.Net® integration. In addition, a PayPal® Express Checkout workaround is possible when a PayPal® Pro account is not possible. For further details, please see: viewtopic.php?f=4&t=304


But even with PayPal® Standard integration, there is a way to accomplish (registration before checkout), thereby reversing the process — if you prefer it that way. This is accomplished by turning Open Registration (on), and then making a PayPal® Button available to Free Subscribers at Level #0. In other words, you can let visitors register for free at Level #0, then charge them for access to higher Member Levels [1-4]. For further details, please check your WordPress® Dashboard under: s2Member -> General Options -> Open Registration. If you're running a Multisite Network, see: s2Member -> Multisite (Config) -> Registration Configuration.

s2Member's Simple Conditionals can help you further integrate this process, by allowing you to integrate a special PayPal® Button on your Login Welcome Page; one that will be seen only by Free Subscribers at Level #0. Please check your WordPress® Dashboard under: s2Member -> API Scripting -> Simple Conditionals. We also suggest reading over the documentation on PayPal® Modification Buttons. See: s2Member -> PayPal® Buttons -> Subscription Modifications.



Is there any way to do this quickly? If not, anyone know what files I would need to "adjust" to add this functionality myself? Most of my customers will not want to fill in all their information twice and I would like to not make them if possible.

Pre-populating registration fields is not possible by default, because in the free version of s2Member, the built-in WordPress® Login/Registration system is used; and it does not provide this capability. That being said, you could certainly accomplish this by making direct code edits to /wp-login.php.

It is also possible to Hook into s2Member's Auto-Return URL processing for PayPal Standard integration. Here is how you might grab variables after a customer has completed checkout, and just before they are presented with the default registration form.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php

Inside the file, do something like this:
Code: Select all
<?php
add_action
("ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars", "my_checkout_redirection");

function my_checkout_redirection($vars = array())
    {
        //print_r($vars["paypal"]); // to get a full list during testing.
        $first_name = $vars["paypal"]["first_name"];
        $last_name =  $vars["paypal"]["last_name"];
        $register_url = c_ws_plugin__s2member_utils_urls::wp_register_url ();
        wp_redirect($register_url);
        exit();
    }
?>
* This requires s2Member v3.5.4+ for it to work as expected.
~ 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: Auto Fill Registration Form

Postby Jason Caldwell » March 19th, 2011, 1:28 am

* Note. The $vars array is passed in by the Hook inside s2Member.
——— s2Member will do this within it's routine:
Code: Select all
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars", get_defined_vars ()); 
So, when/if you connect your function to this s2Member Hook, s2Member will pass in ALL defined variables contained within the scope of the Hook. In the example above, you would be passed the array of variables that exist in the scope of this Hook. In the scope of this Hook, a $paypal array exists, and so the Hook is going to provide you with $vars["paypal"], which is an array of all variables received from PayPal. This Hook is found inside: /s2member/includes/classes/paypal-return-in.inc.php

Code: Select all
<?php
add_action
("ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars", "my_checkout_redirection");

    function my_checkout_redirection($vars = array())
        {
           // $vars comes from the actual Hook,
           // which passes you the array returned by:
           // get_defined_vars ()
        }
?>

Reference article: http://php.net/manual/en/function.get-defined-vars.php
Reference article: http://codex.wordpress.org/Plugin_API#C ... n_Function
~ 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: Auto Fill Registration Form

Postby dwbiz05 » March 30th, 2011, 8:22 am

wow, I've been busy and didn't check back until now. I've got a lot of reading to do!

Thanks for the help!
Dave
User avatar
dwbiz05
Registered User
Registered User
 
Posts: 11
Joined: March 17, 2011

Re: Auto Fill Registration Form

Postby dwbiz05 » April 26th, 2011, 3:46 pm

I'm writing a function that evaluates the user's zip code when they register and then re-directs them to the correct paypal form based on their zip code.

2 questions.

1. What is the best way to grab their zip code from the custom registration fields during / after the registration process?
2. What hook should I add my function to to make this work best?

It should be processed after the user is registered but I would like to re-direct before/instead of showing the standard "Your password has been e-mailed to you" page.

Thanks,
Dave
User avatar
dwbiz05
Registered User
Registered User
 
Posts: 11
Joined: March 17, 2011

Re: Auto Fill Registration Form

Postby Jason Caldwell » April 27th, 2011, 2:31 am

Thanks for the follow-up.

Just to confirm, are you running s2Member Pro Forms now?

The best way to do this, is with a Custom Return URL on Success, which works with s2Member Pro Forms. There is documentation on this, including how you can receive all data from Custom Registration Fields at a URL of your choosing; giving you the ability to display a custom Thank-You Page after a successful transaction is completed. Inside your Dashboard, please see:
s2Member -> PayPal Pro Forms -> Custom Return URLs.
~ 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: Auto Fill Registration Form

Postby sguk2011 » September 4th, 2011, 6:01 am

just a quick add on to this discussion which relates to mine at viewtopic.php?f=4&t=14833&p=33911#p33911

I've just found out that if someone doesn't pay with a paypal account, they are not redirected back to our website. Does this mean the custom url on success doesn't work?

I'm really struggling to get ours working and have pressure to meet a deadline
User avatar
sguk2011
Registered User
Registered User
 
Posts: 28
Joined: September 2, 2011

Re: Auto Fill Registration Form

Postby Jason Caldwell » September 6th, 2011, 2:36 pm

Thanks for your inquiry.
I'll pick this up in your thread shortly.
viewtopic.php?f=4&t=14833&p=33911#p33911
~ 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


Return to s2Member Plugin

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests

cron