CoursePress integration with Profile Builder

Good morning!

I would like to know how can I open the Profile Builder register page when a student enroll a course. Currently when a student click "enroll" it opens a regular register/login form, however I would like to use Profile Builder login/register pages.

  • Kasia Swiderska

    Hello Everaldo,

    Currently when a student click "enroll" it opens a regular register/login form,

    You mean that PopUp with registration form? I'm afraid this is custom CoursePress form and that cannot be change in plugin options.
    This would require changing JS code for [course_join_button] shortcode. This shortcode is responsible for displaying Enroll button and triggering form.

    In wp-content/plugins/coursepress/js/front-enrollment-process.js file in line 56 there is

    $( document.body ).on( 'click', 'button.apply-button.signup, .cp_signup_step', function( e ) {
            e.preventDefault();
            e.stopPropagation();
    
            var course_id = $( this ).attr( 'data-course-id' );
            open_popup( 'signup', course_id );
        } );
    
        /* Enroll (logged in users) */
        $( 'button.apply-button.enroll' ).click( function( e ) {
            e.preventDefault();
            e.stopPropagation();
            open_popup( 'enrollment', $( this ).attr( 'data-course-id' ) );
        } );
    
        /* Login Step */
    
        $( document.body ).on( 'click', '.cp_login_step', function( e ) {
            e.preventDefault();
            e.stopPropagation();
            open_popup( 'login', $( this ).attr( 'data-course-id' ) );
        } );

    each line with open_popup opens popup. So it would need to be removed and then replaced with code like that

    window.location.href = "http://example.com";

    where http://example.com would be link to your custom registration form.
    Before doing any changes please make sure that you have a copy of file you will work on.
    Also you have to remember about that change in the future as plugin updates will remove it.

    kind regards,
    Kasia

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.