Simple Membership Plugin › Forums › Simple Membership Plugin › Redirect after registration
Tagged: redirect
- This topic has 25 replies, 8 voices, and was last updated 6 years, 5 months ago by Bruk.
-
AuthorPosts
-
May 22, 2017 at 11:13 pm #11003serveothersParticipant
What I have currently: Register your account, then re-directs to paypal homepage.
What I want: After you Register your account, then it takes you to the paypal subscription checkout.
I just need the PHP to execute a click on some short code so that It takes newly registered users to the correct place.
(((This code makes a button apear on the page, when you click it, it will take you to the subscription checkout. I want the php too take you to this page after registration is complete and entering “https://www.paypal.com/cgi-bin/webscr” dosn’t work)))
<form action=”https://www.paypal.com/cgi-bin/webscr” method=”post” target=”_top”><input name=”cmd” type=”hidden” value=”_s-xclick” />
<input name=”hosted_button_id” type=”hidden” value=”94YZKTSX4ZC5Q” />
<input alt=”PayPal – The safer, easier way to pay online!” name=”submit” src=”https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif” type=”image” />
</form>May 22, 2017 at 11:14 pm #11004serveothersParticipantMay 23, 2017 at 12:17 am #11005mbrsolutionModeratorHi, if you are referring to the following function. What you need to do is change the URL from PayPal to the URL page you want to redirect the subscribers too.
/**redirect new users to subscribe now page**/ add_action(‘swpm_front_end_registration_complete’, ‘sam_after_registration_redirection’); function sam_after_registration_redirection() { $url = ‘https://www.paypal.com/cgi-bin/webscr’;//TODO – Specify the URL that you want to redirect to wp_redirect($url); } function executeShortCode() { <?php echo do_shortcode(‘[yourshortcode]’); ?> }
May 23, 2017 at 12:32 am #11006serveothersParticipant@mbrsolution I need to redirect the newly registered users to the subscription page right after they complete the registration. There isn’t any way you think this could work? You can’t execute a shortcode after registration is complete?
May 23, 2017 at 12:49 am #11007mbrsolutionModeratorHi, the plugin developers will investigate further your request.
Thank you
May 23, 2017 at 4:49 am #11009serveothersParticipantSo they’ll just email me or what?
May 25, 2017 at 1:48 am #11027adminKeymasterWhat you explained doesn’t make sense to me so my answer may not be correct. You can’t register and redirect to paypal at the same time. The member has to click on a paypal button to be sent to paypal.
Lets say the URL of the page that has your paypal button is: https://www.yoursite.com/join-us/
Then the following custom code will redirect the user to that page AFTER they complete the registration (basically after they submit the registration form). Then the user will click on the paypal button and make payment.
add_action('swpm_front_end_registration_complete', 'sam_after_registration_redirection'); function sam_after_registration_redirection() { $url = "https://www.yoursite.com/join-us/"; //TODO – Specify the URL that you want to redirect to wp_redirect($url); }
You will just need to plug the actual URL of the page where you have the payment buttons.
May 25, 2017 at 4:24 am #11029serveothersParticipantThat is frustrating that I can’t direct them to subscription checkout page right after they register. I don’t want to send them to the subscription checkout page right away because that’s a little scammy and unprofessional. But I also don’t want them to go through the process of clicking get started, registering, back to the main page, clicking another button to get to the checkout, and finally paying. It’s either too few steps or too many, you know what I mean? Any solutions that you can think of?
May 26, 2017 at 12:59 am #11040adminKeymasterI understand what you are saying but you can’t offer all the different payment gateways that we are offering (we intend to add more) and tie them all to the register button. It just doesn’t work that way.
You are going to need a different plugin that does what you are after unfortunately.
October 24, 2017 at 7:13 am #12250BrukParticipantHi,
This code is perfect. Thank you!
add_action(‘swpm_front_end_registration_complete’, ‘sam_after_registration_redirection’);
function sam_after_registration_redirection()
{
$url = ‘http://www.yourwebsite.com/thank-you/’;//TODO – Specify the URL that you want to redirect to
wp_redirect($url);
}Can you send an another code for “after payment”? Now, if the payment is successful the user is redirected to the homepage. I’d like to redirect a different (“thank you”) page.
Thank you.
David
October 24, 2017 at 1:37 pm #12255BrukParticipantSorry I’m really st.pid. 🙂 I can add Return URL, so I don’t need code.
Really sorry.
Thanks,
David -
AuthorPosts
- You must be logged in to reply to this topic.