login forget password

Hi

When signing up for a course I get get the option of "Already have an account"

If the customer forgot password there is no way for them to reset it

What is the solution for this ?

http://seo-splash.co.il/nitza/courses

to replicate sipmly signup for a course. then try via incognito to signup for another course
and clicking on already have an account
thanks

  • Dimitris

    Hello Ofir,

    hope everything's fine with you and thank you for reaching us! :slight_smile:

    As you already said, there's no "forget password?" link in login popup window, although there's already a URL in place for doing so -> http://seo-splash.co.il/nitza/my-account/lost-password/
    What we have to do now is to override this login popup template in order to insert in there this link. First of all, you should create a PHP file like

    <?php
    add_filter( 'coursepress_signup_steps', 'coursepress_signup_steps_cb' );
    function coursepress_signup_steps_cb( $signup_steps ){
    	$signup_steps['login']['template'] = get_stylesheet_directory() . '/coursepress/popup-window-login.php';
    	return $signup_steps;
    }
    ?>

    Save it as a MU plugin (you can just call it mycoursepress.php).

    Then, under your child-theme, create a folder named coursepress and in there create a new file called popup-window-login.php which should look like this

    <form id="popup_login_form">
    	<div class="cp_popup_title"><?php _e( 'Login', 'cp' ); ?></div>
    
    	<input type="hidden" name="signup-next-step" value="enrollment"/>
    
    	<p class="cp_popup_required"><?php _e( 'Login with your existing username and password', 'cp' ); ?></p>
    
    	<label class="cp_popup_col_1">
    		<input type="text" class="required" id="cp_popup_username" value="" placeholder="<?php _e( 'Username', 'cp' ); ?>">
    	</label>
    
    	<label class="cp_popup_col_1">
    		<input type="password" class="required" id="cp_popup_password" value="" placeholder="<?php _e( 'Password', 'cp' ); ?>">
    	</label>
    
    	<?php
    	$course_id = isset( $_POST['course_id'] ) ? (int) $_POST['course_id'] : ' ';
    	$course    = new Course( $course_id );
    	if ( $course->details->enroll_type == 'passcode' ) {
    		?>
    		<label class="cp_popup_col_1">
    			<input type="text" class="required" name="passcode" id="cp_popup_passcode" placeholder="<?php _e( 'Course Passcode', 'cp' ); ?>"/>
    		</label>
    	<?php } ?>
    
    	<input type="hidden" value="<?php esc_attr_e( isset( $_POST['course_id'] ) ? (int) $_POST['course_id'] : ' ', 'cp' ); ?>" name="course_id"/>
    
    	<div class="cp_popup_buttons login_buttons">
    		<?php wp_nonce_field( 'popup_login_nonce', 'submit_login_data' ); ?>
    		<div class="validation_errors"></div>
    
    		<input type="hidden" name="data-course-id" id="data-course-id" value="<?php esc_attr_e( isset( $_POST['course_id'] ) ? (int) $_POST['course_id'] : ' ', 'cp' ); ?>"/>
    
    		<label class="cp_popup_col_2">
    			<a href="" class="cp_signup_step" data-course-id="<?php esc_attr_e( isset( $_POST['course_id'] ) ? (int) $_POST['course_id'] : ' ', 'cp' ); ?>"><?php _e( 'Create an Account', 'cp' ); ?></a>
    		</label>
    
    		<label class="cp_popup_col_2">
    			<a href="<?php echo get_home_url(); ?>/nitza/my-account/lost-password/">Lost Password?</a>
    		</label>
    
    		<label class="cp_popup_col_2 second-child">
    			<button class="apply-button login" data-course-id="<?php esc_attr_e( isset( $_POST['course_id'] ) ? (int) $_POST['course_id'] : ' ', 'cp' ); ?>"><?php _e( 'Login', 'cp' ); ?></button>
    		</label>
    	</div>
    </form>

    It's actually the same file like in wp-content/plugins/coursepress/includes/templates/popup-window-login.php with the addition of lines#38~40 (in where we placed the "forgot password?" link).

    Please take notice couple of things though:
    1. The link I've used is
    <?php echo get_home_url(); ?>/nitza/my-account/lost-password/
    so you have to keep this in mind if you ever change a subfolder in your installation (the nitza part)
    2. Don't use your parent theme to embed the new template file, as it will disappear if you update. Please do use a child-theme in order to update your parent theme without fear. :wink:

    Looking forward for your results on this, feel free to ask for more help if required! :slight_smile:
    Warm regards,
    Dimitris