Page 1 of 1
Customize redirection after users register...

Posted:
October 13th, 2011, 12:55 pm
by s_d_p
I'm trying to return users to the page they left in order to register.
I've learned that WP will automatically redirect to a url if you include a hidden field in the registration form named "redirect_to" with a value equal to the url you want to send the user to after login. I was able to this hidden field in the s2Member registration form using a jquery script (because s2Member doesn't give an option for a hidden custom field). However, it appears that s2Member is over-riding this behavior. Upon login, users are still sent to their member profile page.
Can you give me any advice on how I might be able to achieve this user experience? As a last resort, I was thinking about passing a url parameter from the original page, to the login form, and then to the member profile page so that I could at least place a link back to it. I suspect this will work, but it's not a very elegant solution.
Re: Customize redirection after users register...

Posted:
October 14th, 2011, 4:23 pm
by Eduan
So you mean like redirecting them to the login page right after they register?
Re: Customize redirection after users register...

Posted:
October 14th, 2011, 9:49 pm
by s_d_p
Nope. The login page already appears right after the registration. What I need is to send users to specific page after they log in. A new user registers, logs in, and arrives at the original page they left to register.
Re: Customize redirection after users register...

Posted:
October 15th, 2011, 7:56 am
by Eduan
Do you need to do this every time or just the first login?
Re: Customize redirection after users register...

Posted:
October 15th, 2011, 10:10 am
by s_d_p
The first login is the most important, but it would also be useful for subsequent logins as well. We have several features that require login/registration to use, and the s2Member plugin dumps them on the member profile page by default. So it's a little inconvenient from a user experience standpoint.
Re: Customize redirection after users register...

Posted:
October 15th, 2011, 10:14 am
by Eduan
Have you tried
One-Time-Offers?
You'll find it under
WP Admin -> s2Member -> General Options -> One-Time-Offers ( Upon Login ).
Hope this helps.

P.S. Remember to report back.

Re: Customize redirection after users register...

Posted:
November 10th, 2011, 7:55 am
by Julien
Hello !
I would be very interested to know how, after a membre loged in, he can be automaticaly redirected to the protected page he wanted to reach, and not being redirected to the Login Welcome Page
here is the process :
An existent membre arrives on my site, not logged in
He wants to reach a "membre only page" by clicking on a link (URL1)
s2Member redirect the membre on my Membership Options Page which asks him to login.
On this page, he clicks on Log in and then he can log in on my registration page (wp-login.php)
And here is the point i would like to improve. In the present situation, the membre is redirected to my "Login Welcome Page". The membre has then to find by himslef the page he wanted to reach (URL 1).
-> Would it be possible, just after he logged in, to be AUTOMATICALLY redirected to URL1 he wanted to reach. In order to reduce the numbre of steps to arrive on URL1
Thanks a lot ! I hope evertuthing is clear ! And thanks in advance for your help
Re: Customize redirection after users register...

Posted:
November 12th, 2011, 2:05 am
by Cristián Lávaque
If you have s2Member Pro, you can use the success attribute and customize it using the Membership Options Page variables. Maybe something like:
- Code: Select all
[s2Member-PayPal-Button level="1" ccaps="" desc="Bronze Member / Description and pricing details here." ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="yoursite.com" ta="0" tp="0" tt="D" ra="0.01" rp="1" rt="M" rr="1" rrt="" rra="1" image="default" output="button" <?php $_g = stripslashes_deep($_GET); if (isset($_g['_s2member_seeking']['_uri']) { echo 'success="' . site_url() . '/wp-login.php?action=register&redirect_to=' . base64_decode($_g['_s2member_seeking']['_uri']) . '"'; } ?> /]
* I haven't tested this code.WP Admin -> s2Member -> PayPal Buttons -> Shortcode Attributes -> success
WP Admin -> s2Member -> PayPal Pro-Forms -> Custom Return URLs On Success
WP Admin -> s2Member -> API / Scripting -> Membership Options Page Variablesviewtopic.php?f=36&t=1604I hope this helps.

Re: Customize redirection after users register...

Posted:
November 16th, 2011, 3:47 am
by Julien
Hi Cristian thanks a lot for your answer but i do not use s2member pro...
Any idea how to improve my log in process as described in my post with the free version ?
Thanks in advance
Julien
Re: Customize redirection after users register...

Posted:
November 16th, 2011, 1:42 pm
by Bruce C
You can set a hook on
user_register to set the header to a different value.
Something like:
- Code: Select all
<?php
function custom_url_on_registration ()
{
header ('Location: http://yoursite.com/wp-login.php?redirect_to=/page=1');
exit ();
}
add_action('user_register', 'custom_url_on_registration');
?>
I haven't tested it so I'm not 100% sure it works.
Re: Customize redirection after users register...

Posted:
November 16th, 2011, 1:55 pm
by Bruce C
Just another note, could it be possible to set a cookie when the s2meber_seeking $_GET variable is in place, then use that as the redirect_to content?
Something like:
- Code: Select all
<?php
function set_cookie_s2member_seekings_custom (){
if (!empty($_GET['s2member_seeking]'))
{
setcookie('custom_redirectto_page', $_GET['s2member_seeking']);
}
}
add_action('init', 'set_cookie_s2member_seekings_custom');
?>
Then, when you need it, just get it like this: $_COOKIE['custom_redirectto_page']
Re: Customize redirection after users register...

Posted:
November 18th, 2011, 7:53 pm
by immanence
I wonder if I can ask a related question. I have s2member Pro, and basically I need to get people to buy access to specific pages for about 30 products (I'm streaming video, and this needs to be members only, but on a video-by-video basis). So I don't want to give access to all the videos at once (I may use the levels to create packages of videos, however). So I what I need to do is:
User goes to Product 1. Clicks on Streaming. Is redirected to a page where they buy access to one video. Then redirected to the page where that single video is streamed.
Is this possible? I'm rather confused as to how I would do this!
Any help or pointers MUCH appreciated!
Re: Customize redirection after users register...

Posted:
November 19th, 2011, 7:44 pm
by Raam Dev
Hi immanece,
It sounds like you could solve this by creating separate Buy Now buttons for each product and then setting up separate pages where your users can purchase access.
So, you'd create a page for Product 1, another page for the streaming, and a third page to purchase access.
When the user clicks on Product 1 and then clicks on Streaming, s2Member would detect that the Streaming page is protected and redirect the user to the Membership Options Page.
When the redirect happens, s2Member includes some variables about the page being redirected from and sends them to the Membership Options Page. You can read these variables on the Membership Options Page and then redirect them away from the Membership Options Page and to a purchase page specific to the page they originally came from.
See an example of how I did this here:
viewtopic.php?f=4&t=14947#p53487Will that work for you?
Re: Customize redirection after users register...

Posted:
November 19th, 2011, 9:23 pm
by alione
Hi Sorry I dont have the technical know how to actually answer the initial query but would like to add myself to the brains involved in your dialogue.
We have installed s2 member and pro but dont have a paypal pro account.
I just want the simple redirect back to our site after a member completes his payment info on paypal so it redirects back to the registration form but it isnt redirecting. I have turned payment transfer and auto return on but it doesnt actually return.
Can you guys solve this. Is there something I am missing. I didnt think I had to change that much because the payment info would take place on paypals site rather than ours.
When I use a normal paypal button it redirects just fine but I want to use s2 member as a management system so I can issue discount codes etc.
Please help...
Re: Customize redirection after users register...

Posted:
November 19th, 2011, 9:43 pm
by Raam Dev
alione,
If you have s2Member Pro, you can use the s2Member Pro Forms (
WP Admin -> s2Member -> Paypal Pro Forms). You don't need a Paypal Pro account to use the s2Member Pro Forms:
*PayPal® Pro is NOT Absolutely Required* s2Member is very flexible. It is now possible to integrate Pro Forms without a PayPal® Pro account, whereby the enhanced Form Shortcodes that s2Member provides can be integrated ONLY with PayPal® Express Checkout. In other words, if you get declined for PayPal® Pro service, you can still use s2Member Pro Forms. Ask PayPal® to activate Express Checkout for you. ( it's free ). Once Express Checkout is enabled, you will have access to your PayPal® API Credentials. Log into your PayPal® account, and navigate to Profile -> API Access (or Request API Credentials). You'll choose ( Request API Signature ). Now ... here is the tricky part; whenever you generate a Pro Form Shortcode with s2Member, be sure to change accept="paypal,visa,mastercard,amex,discover,maestro,solo" to just accept="paypal"; thereby excluding the on-site credit card processing functionality; which is available only with PayPal® Pro.
When you use s2Member Pro Forms, all the s2Member registration will happen before the user even goes to Paypal. Then you won't need to redirect them back to the registration form, but instead just redirect them to a Thank you page (or to the login page).
You can set the redirect after Paypal payment by adding a
success="" attribute to the Pro From shortcode that includes the URL you want to redirect to after a successful Paypal payment. You can read more about this and other shortcode attributes here:
WP Admin -> s2Member -> Paypal Pro Forms -> Shortcode Attributes (Explained).
Does that answer your question?
Re: Customize redirection after users register...

Posted:
November 19th, 2011, 10:44 pm
by alione
Hi Raam Dev, thanks so much for your reply - my problem with the pro form is that I want the member to be able to use debit or credit card if they dont have paypal and as yet we dont have paypal pro more because we dont yet have the https thing (ssl) thing setup so I need the payment to be done on paypal first.
Overall I want members to be able to pay using their own payment choice not just paypal and then it should atleast redirect back so they can complete their registration – and there should be somewhere that they enter any of the discount codes we add.
I realise to use pro forms I need to sort out all the https but I would like to atleast use buttons for now so it works and then we can improve the site in time…
When I use a button created by s2member after the payment is made it says please contact the website host for info it doesnt actually return to the registraton form.
Ultimately we do want the site to be improved but for right now I just want it to work...can you see what the issue could be. Also do you take on any jobs of this kind?
Re: Customize redirection after users register...

Posted:
November 20th, 2011, 1:07 pm
by alione
Hi I have now realised the following dilemma...I cant use discount codes with using proforms, and I cant use pro forms without using ssl/https url.
Thats no fun!Could anyone point me in the direction of someone who could implement this for us, as in ensure our word press theme is compatible, set up the ssl/https and configure the forms to work accurately.
I did attempt to submit a job to ACE but am not sure if this comes under an installation.
Anybody...it has been really difficult to get this sorted and this forum is the only method to find anyone who knows about this plugin. I love the plugin but just want someone who can jim'll fix this for us and let us know approximately how much it will cost.
Hope to hear from someone soon.
Peace
Re: Customize redirection after users register...

Posted:
November 20th, 2011, 2:34 pm
by Eduan
Hi alinoe,
could you post the job again? It should work now.