Page 1 of 1

Redirect Upon Registration...

PostPosted: October 26th, 2011, 10:02 am
by godrob
Hi guys,

I'm using the the pro form to bring new members in at level 1 on a 14 day free trial. This all works fine. However, after they have filled out the registration form, a hidden div appears saying
Thank you. Please login.


What I want to happen instead, is for new members to automatically be redirected to a new page, immediately after registration, rather than the hidden
Thank you. Please login
. div appear on the registration form.

I thought I could do this simply by adding a redirect in s2member-pro "paypal-responses.inc.php", but in doing so, I think it no longer registers new users properly, as the first and last names are no longer populated in the Dashboard, and also the "Display name publicly as" doesn't update any more...

Here's the section of code with the bad redirect:

Code: Select all
   /**
            * Creates response divs after Registration processing.
            *
            * @package s2Member\PayPal
            * @since 1.5
            *
            * @param array $attr An array of Pro Form Attributes.
            * @return array An array of response details.
            */
            public static function paypal_registration_response ($attr = FALSE)
               {
                  $_response = $GLOBALS["ws_plugin__s2member_pro_paypal_registration_response"];
                  /**/
                  $_response = (!$_response) ? c_ws_plugin__s2member_pro_paypal_responses::paypal_form_attr_validation_errors ($attr) : $_response;
                  /**/
                  if ($_response && ($error = $_response["error"])) /* Error reporting. */
                     {
                        $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-error s2member-pro-paypal-registration-form-response-error">';
                        $response .= $_response["response"];
                        $response .= '</div>';
                     }
                  else if ($_response) /* Otherwise, we treat this as an informational response. */
                     {
                        $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-info s2member-pro-paypal-registration-form-response-info">';
                        $response .= $_response["response"];
                        $response .= '</div>';
                        wp_redirect( '/activate-your-account/' );
                     }
       /**/


Can somebody please tell me the right way of doing this please?

All I want to do is automatically send them to a page, after registration, telling them to check their email to activate their account. Which is basically just an aweber confirmation email.

Thanks
Rob.

Re: Redirect Upon Registration...

PostPosted: October 26th, 2011, 10:15 am
by Eduan
Have you tried one-time-offers?
You'll find them under WP Admin -> s2Member -> General Options -> Optional One-Time-Offers ( Upon Login ).

Hope this is what you're looking for. :)

Re: Redirect Upon Registration...

PostPosted: October 26th, 2011, 10:32 am
by godrob
Yes, thanks Eduan, I was going to use that as last resort. The OTO obviously requires the user to login first though. What I wanted was the user to be redirected immediately after completing registration, before actually logging in.

Any ideas?

Thanks
Rob.

Re: Redirect Upon Registration...

PostPosted: October 26th, 2011, 10:38 am
by Eduan

Re: Redirect Upon Registration...

PostPosted: October 26th, 2011, 10:42 am
by godrob
Yes, pretty much, this is what I'm using which redirects after registration:

wp_redirect( '/activate-your-account/' );

This redirects just fine, BUT somehow breaks the input of some fields (see above)...

Thanks
Rob.

Re: Redirect Upon Registration...

PostPosted: October 26th, 2011, 11:20 pm
by Cristián Lávaque
You can use the success attribute in the pro-form's shortcode. WP Admin -> s2Member -> PayPal Pro-Forms -> Custom Return URLs On Success

I hope that helps. :)

Re: Redirect Upon Registration...

PostPosted: October 27th, 2011, 5:42 am
by godrob
Thanks Cristian!

Re: Redirect Upon Registration...

PostPosted: October 27th, 2011, 10:26 pm
by Cristián Lávaque
No problem. :)