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™

s2Member Pro / login redirect to originating page

s2Member Plugin. A Membership plugin for WordPress®.

s2Member Pro / login redirect to originating page

Postby Allan_2011 » March 17th, 2011, 4:59 am

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 )
User avatar
Allan_2011
Registered User
Registered User
 
Posts: 2
Joined: March 17, 2011

Re: s2Member Pro / login redirect to originating page

Postby Cristián Lávaque » March 17th, 2011, 12:00 pm

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.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: s2Member Pro / login redirect to originating page

Postby Allan_2011 » June 14th, 2011, 3:27 pm

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
User avatar
Allan_2011
Registered User
Registered User
 
Posts: 2
Joined: March 17, 2011

Re: s2Member Pro / login redirect to originating page

Postby Cristián Lávaque » June 14th, 2011, 6:57 pm

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.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: s2Member Pro / login redirect to originating page

Postby oli4uk » October 15th, 2011, 10:15 pm

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
User avatar
oli4uk
Registered User
Registered User
 
Posts: 1
Joined: October 5, 2011

Re: s2Member Pro / login redirect to originating page

Postby referee » February 2nd, 2012, 12:25 pm

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.
User avatar
referee
Registered User
Registered User
 
Posts: 1
Joined: January 26, 2012

Re: s2Member Pro / login redirect to originating page

Postby bglclub » February 2nd, 2012, 6:52 pm

I need this same solution, or rather question answered. Where do we paste this code? I have S2Member Pro
User avatar
bglclub
Registered User
Registered User
 
Posts: 1
Joined: February 2, 2012

Re: s2Member Pro / login redirect to originating page

Postby Cristián Lávaque » February 3rd, 2012, 4:17 am

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!
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

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

cron