Redirect after Log in
-
For those of you who are puzzled over the logging in issue Learnpress presents when a user logs in and enrolls, or when a user purchases a product, there is no need to abandon the plugin entirely! This may be a quick fix but it all lies within this little snippet of code in the form-register.php and form-login.php located within the wp-content/plugins/learnpress/templates/global folder and the wp-content/plugins/learnpress/templates/checkout folder in Learnpress:
<form name=”learn-press-register” method=”post” action=””>
Here are the steps to take
STEP 1:
in your /global folder
open: form-register.php
change <form name=”learn-press-login” method=”post” action=””>
to: <form name=”learn-press-register” method=”post” action=”/profile”>(this will create a redirect back to the users PROFILE page after they complete Learnpress registration. They will be logged in and registered as a student and immediately able to access the dashboard.)
Make a duplicate copy of form-register.php and name it checkout-form-register.php
Keep this: <form name=”learn-press-register” method=”post” action=””>
(when action=”” is left blank, the user is directed back to the previous page they were on after making a purchase.)
STEP 2
open form-login.php
change <form name=”learn-press-login” method=”post” action=””>
to: <form name=”learn-press-login” method=”post” action=””>Make a duplicate copy of form-login.php and name it checkout-form_login.php
Keep this: <form name=”learn-press-login” method=”post” action=””>
STEP 3
Upload the four PHP files back to your GLOBAL folder:
form-login.php
checkout-form-login.php
form-register.php
checkout-form-register.phpSTEP 4
in your /checkout folder:
open: form-register.php
change: <?php learn_press_get_template( ‘global/form-register.php’ ); ?>
to: <?php learn_press_get_template( ‘global/checkout-form-register.php’ ); ?>STEP 5
open form-login.php
change <?php learn_press_get_template(‘global/form-login.php’);?>
to: <?php learn_press_get_template(‘global/checkout-form-login.php’);?>STEP 6
Upload the two PHP files you just edited back to your CHECKOUT folder:
form-login.php
form-register.php
- The topic ‘Redirect after Log in’ is closed to new replies.