Auto-Enroll with CoursePress Pro WooCommerce Integration

I recently learned through the comment section on the post below that the only way a User is automatically enrolled in the Course they purchase as a Student is if the purchase originates from the Course Details Page Enroll Now button.

We’re Experimenting: CoursePress Gets WooCommerce Integration

I am using a landing page as a sales page for a product launch. My plan was to use a link that would send the User to Checkout for the Product/Course based on the WooCommerce link for the Product, but my understanding is that this will not auto-enroll the User as a Student.

Is there any way to have the auto-enroll work outside of the Course Page? I use LeadPages and they have Javascript that works with their buttons. If you want to use your own buttons instead, you just have to put the Javascript somewhere on the page and it will work properly.

Would that be an option here? If I ‘hid’ the CoursePress Pro Enroll Now Javascript somewhere on my landing page and then used the WooCommerce link for the button would it work?

Or is there another approach that will enable us to do this?

Thanks,

Jesse

  • Vinod Dalvi
    • WP Unicorn

    Hi Jesse,

    I hope you are well today and thank you for your question.

    You can try using any of the following CoursePress shortcodes to auto-enroll work outside of the Course Page.

    [course]
    [course_join_button]

    You will find more information about the shortcodes on the following path.

    Admin Area -> CoursePress Pro -> Settings -> Shortcodes

    Best Regards,

    Vinod Dalvi

  • Jesse
    • Site Builder, Child of Zeus

    Hi, thanks for the quick response.

    That won’t work because I am trying to do it on a landing page that isn’t inside of WordPress.

    Is there another approach?

    Related question, is there any way to adjust the WooCommerce Add to Cart button with that shortcode so that it has the same functionality?

    Thanks,

    Jesse

  • Vinod Dalvi
    • WP Unicorn

    Hi Jesse,

    The CoursePress Pro enroll button won’t work outside the WordPress as the form containing the button is posted by POST method and not GET method. Also the WordPress Nonces are handled in the form therefore it will only work in WordPress.

    What you can do to achieve it is append some query string to the course details page URL and use it on your landing page then when any user clicks on it they will redirect to the single course details page where you can develop custom code to auto enroll logged in users based on the query string.

    Youw ill have to develop some custom code to achieve this. If you are not a programmer then you can consider hiring a developer from https://premium.wpmudev.org/wpmu-custom-development/ to develop it for you.

    Regards,

    Vinod Dalvi

  • Vinod Dalvi
    • WP Unicorn

    Hi Jesse,

    Ok, so does the Enroll Now button only work when a user is logged in?

    Yes

    Will the auto enroll work if the user account is created when the product is purchased in WooCommerce?

    The course enrollment will work after the user is registered and logged in regardless how the user account is created.

    For auto enroll after user registration, you have to use the custom code provided in the following reply.

    Coursepress Auto Register User

    Cheers,

    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.