Page 1 of 1

s2Member Pro / login redirect to originating page

PostPosted: March 17th, 2011, 4:59 am
by Allan_2011
Hi,
I would like a smoother user experience for our site members when they login. At the moment after logging in, you are redirected to a preset page, f.ex. "Home" (s2Member admin setting).
What I would like is that when you login into a certain page, that in this case is membership restricted, other pages are "open access", you will, after logging in, return to the page you came from, (originating page).
Can this be done?
Have had no luck so fare in finding info on this.

Any help solving this is much appriciated.
Thanks,
Allan ( s2Member Pro newbie )

Re: s2Member Pro / login redirect to originating page

PostPosted: March 17th, 2011, 12:00 pm
by Cristián Lávaque
Hello Allan.

Perhaps the Membership Options Page Variables could help you with this. Read about them here WP Admin -> s2Member -> API / Scripting -> Membership Options Page Variables.

Re: s2Member Pro / login redirect to originating page

PostPosted: June 14th, 2011, 3:27 pm
by Allan_2011
Hello Cristián,
Thank you for your reply.
I'm still kind of lost.
Allow me to clarify: I'm only operating with one s2member level (... level 1). My aim is to have logged in member return to the orignating page/ the page where they logged in to access a level 1 page. The default is to direct logged in members to the homepage, which is not so userfriendly, forcing users to refind the page they tried to login to. I hope i'm making myself clear.
I'm thinking, surely there has to be a standard code to accomodate this?
Hope you can help.
Thank you,
Allan

Re: s2Member Pro / login redirect to originating page

PostPosted: June 14th, 2011, 6:57 pm
by Cristián Lávaque
Well, s2Member Pro's Pro Login Widget has an option to return to the page the person logged in from, if I'm not mistaken. WP Admin -> Widgets -> Pro Login Widget

Now, if you the person tries to load a Level 1 page while not logged in, he gets sent to the Membership Options Page, there he logs in, the Pro Login Widget will return him to the page he logged in from: the Membership Options Page. So that doesn't work well.

That's why I pointed you to the Membership Options Page Variables, because they tell you what the person tried to view that got him sent to the Membership Options Page. You can use these variables to create a redirection URL to send the person to after login.

You can point the person to the login page with the redirection value at the end, like http://example.com/wp-login.php?redirect_to=/theprotectedpage

I hope that helps.

Re: s2Member Pro / login redirect to originating page

PostPosted: October 15th, 2011, 10:15 pm
by oli4uk
I am having the same problem, when somebody registers/logs in I want to return them to the page that they signed up through.

That way it goes

User finds product
User Registers/Logs In
User Purchases Product
User Downloads Product.

I want them to be able to do this without having to re-find the page they were on previously.

Is this impossible, insanely difficult, or am I just missing something? :P

Re: s2Member Pro / login redirect to originating page

PostPosted: February 2nd, 2012, 12:25 pm
by referee
Cristián Lávaque wrote:You can point the person to the login page with the redirection value at the end, like http://example.com/wp-login.php?redirect_to=/theprotectedpage

I hope that helps.


Can you explain this code a little more, how it works and where to place it? Or is this topic covered in a different thread?

Thanks.

Re: s2Member Pro / login redirect to originating page

PostPosted: February 2nd, 2012, 6:52 pm
by bglclub
I need this same solution, or rather question answered. Where do we paste this code? I have S2Member Pro

Re: s2Member Pro / login redirect to originating page

PostPosted: February 3rd, 2012, 4:17 am
by Cristián Lávaque
oli4uk wrote:I am having the same problem, when somebody registers/logs in I want to return them to the page that they signed up through.


You could customize this using the Membership Options Page variables, if you're using a restriction that sends them to that page to sign up for access. WP Admin -> s2Member -> API / Scripting -> Membership Options Page Variables

If you're using conditionals in the page to either show the content or sell them the access to it, then you already have the address of the page right there to work with.

You'd have to save the page somewhere, like a cookie, to use it later after checkout and registration, redirecting them there.

I can't code this for you or go into more detail, but a developer should be able to help you achieve it. There are good freelancers in sites like oDesk.com or eLance.com.

I hope that helps!