Page 1 of 1

Auto-transfer to WP Registration after Payment

PostPosted: November 7th, 2011, 1:58 pm
by Raam Dev
After someone subscribes via Paypal, they are transferred back to my site where s2Member displays a page with a link to go to the Registration page. I'd like to automatically transfer buyers to the registration page to reduce the number of steps required during the subscription process.

I tried modifying s2member/includes/templates/returns/default-return.php by adding a JavaScript redirect that automatically transfers new subscribers to the register page:

Code: Select all
<body onLoad="window.location.href='https://raamdev.com/wordpress/wp-login.php?action=register'">


However, this technique seems to work sporadically. Sometimes the registration page is displayed and other times a message appears that tells paying subscribers that Registration is disabled (I have Open Registration disabled, so only paying subscribers can register). Also, when this happens users never receive the Signup Confirmation email, so they essentially have no way of filling out the registration form.

I'm not sure if there's a better way of doing this or if I'm missing something with how the registration process works. Any help would be greatly appreciated.

Re: Auto-transfer to WP Registration after Payment

PostPosted: November 7th, 2011, 2:16 pm
by Eduan
Are you using pro-forms or PayPal buttons?

If it's pro-forms then try under PayPal® Pro Forms -> Custom Return URLs On Success.

If it's PayPal buttons then I couldn't tell you what to do. :|

Hope this helps. :)
Also remember to report back,
otherwise you leave me worrying. ;)

Re: Auto-transfer to WP Registration after Payment

PostPosted: November 7th, 2011, 2:19 pm
by Raam Dev
Thanks for the reply Eduan.

I'm using Paypal Buttons, not Paypal Pro Forms (can't afford s2Member Pro just yet).

Re: Auto-transfer to WP Registration after Payment

PostPosted: November 7th, 2011, 2:25 pm
by Eduan
Searched a little and here's the result:
success="" Success Return URL ( optional ). s2Member handles this automatically for you. However, if you would prefer to take control over the landing page after checkout ( i.e. your own custom Thank-You Page ), you can. If supplied, this must be a full URL, starting with http://. Note, s2Member will NOT use this value if an existing account holder is being modified. s2Member handles account updates ( i.e. billing modification ) in a more dynamic way. Your Success Return URL is only applied to (new) Customers.

Found this under PayPal® Buttons -> Shortcode Attributes ( Explained ) -> success=""

Hope this helps. :)

Re: Auto-transfer to WP Registration after Payment

PostPosted: November 8th, 2011, 1:46 am
by Cristián Lávaque
Right Eduán, it's the success attribute for PayPal buttons, but comes with the Pro add-on. WP Admin -> s2Member -> PayPal Buttons -> Shortcode Attributes -> success

Raam, you need to let users arrive at the s2Member return page or s2Member won't set the cookies that let him register when you have Open Registration disabled. Even if you had enabled that, they'd be registering but s2Member would not know they paid, so would give them Level 0.

Actually, if I'm not mistaken, by default the person would be shown the registration page after checkout at PayPal... I may be wrong, though. Anyway, this hack may help you viewtopic.php?f=36&t=6386#p14932

Re: Auto-transfer to WP Registration after Payment

PostPosted: November 8th, 2011, 5:13 pm
by Raam Dev
Thanks, Cristián. Unfortunately, I don't have s2Member Pro yet so I can't use the success Shortcode attribute.

Also, the hack you pointed to only works if the page I want to redirect to *is not* the registration page. Since the hack essentially bypasses setting the cookies, redirecting to the registration page results in "Registration Disabled" (since s2Member doesn't know the person just purchased something). On the plus side, with the hack the Paypal Confirmation email is generated, which allows the subscribers to click the link (thereby generating the cookies) and then registering.

However, my intention with redirecting to the registration page was to prevent the number of steps to complete registration. Requiring a subscriber to check their email and click a link to register defeats that purpose.

Re: Auto-transfer to WP Registration after Payment

PostPosted: November 11th, 2011, 12:34 am
by Cristián Lávaque
Yes, I understand that. I was actually meaning the last part of the post I pointed you to. ;)