How to force CoursePress Pro to use the Membership Pro 2 registration/payment process?

In this integration between Membership and CoursePress, how do we make the CoursePress "Register" buttons point to the Memberships Pro 2 memberships page? Right now, the CoursePress "Register" buttons create their own pop-up allowing people to register and access our courses without having to pay for membership.

How do we close this open payment/registration loop?

Note: Your team provided code so that we could deactivate the manual enrollment process, as we want our paid members (logged in) to have direct access to all courses without having to enroll in individual courses.

  • Kasia Swiderska

    Hello Matthew,

    If users can access your courses and not be members of membership it means that you are not protecting your courses with Membership at all.
    In Membership you have to enable add-on "Individual Custom Posts" Protection - after that you'll get new tab in Protection rules -> Custom Post Type Items. On that list find your course and protect them with membership.
    When someone will try to reach that course withour being member, then Membership will show protection message you configured in Membership. When you place there link to registration users will go there and use Membership form to register and then checkout.

    Let me know if you have more questions.

    kind regards,
    Kasia

  • Kasia Swiderska

    Hello Matthew,

    Thank you for explanation. I can now see issue here.

    So, how can I at least hide the CoursePress "Signup!" button on the course pages?

    This will require adding some coursepress templates to your theme and little change in code so it will work with Membership pro, but this is possible.

    First, you would need to copy single.php file in your theme and name it single-course.php.
    Next step is to find in that file where

    the_content()

    function is. I don't know your theme so I cannot be at this point more specific I'm afraid. So when you would localize the_content(), before insert that code

    <?php
    // Show course media
    echo do_shortcode( '[course_media]' );
    
    // Show course summary/excerpt
    echo do_shortcode( '[course_summary length="500"]' );
    ?>
    
    	<div class="divider"></div>
    	<div class="enroll-box">
    		<div class="enroll-box-left">
    			<div class="course-box">
    				<?php echo do_shortcode( '[course_dates show_alt_display="yes"]' ); ?>
    				<?php echo do_shortcode( '[course_enrollment_dates show_enrolled_display="no"]' ); ?>
    				<?php echo do_shortcode( '[course_class_size]' ); ?>
    				<?php echo do_shortcode( '[course_enrollment_type]' ); ?>
    				<?php echo do_shortcode( '[course_language]' ); ?>
    				<?php echo do_shortcode( '[course_cost]' ); ?>
    			</div>
    		</div>
    		<div class="enroll-box-right">
    			<div class="apply-box">
    				<?php echo do_shortcode( '[course_join_button]' ); ?>
    			</div>
    		</div>
    	</div>
    	<div class="divider"></div>
    
    <?php
    //List of instructors
    echo do_shortcode( '[course_instructors show_label="yes" label_element="h2" label_delimeter="" class="instructors-box"]' );
    ?>
    
    <?php
    // Course Structure
    echo do_shortcode( '[course_structure show_label="yes" label_element="h2" label_delimeter="" show_title="no" show_divider="yes"]' );
    ?>

    Part that display signup button is this

    <?php echo do_shortcode( '[course_join_button]' ); ?>

    so it would need to be changed to

    <?php $joinbtn = do_shortcode( '[course_join_button]' ); ?>
    				<?php
    				echo do_shortcode( '[ms-protect-content id="1534"]' . $joinbtn . '[/ms-protect-content]' );
    				 ?>

    where id="1534" is id of your membership. You can find membership ID on the list of memberships when you hover over "Show" in Shortcodes column.

    If you have problem with editing files in your theme - would you mind allowing support access so we can have a closer look at theme and see if I can give you more specific instructions?
    To enable support access you can follow this guide here:
    http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    kind regards,
    Kasia

  • -MK-

    Per your suggestion, I have activated Support access, as the code to remove the Enroll Now button does not seem to work as desired. "Protecting" the content inserts the protected content text in its place.

    I am wanting the "Enroll Now" and/or the "Start Learning" button gone completely, turn off their display entirely.

    Your staff has assisted us with setting up code that will automatically enroll new students in all classes, so the enrollment process is unneeded. Although this code no longer seems to be working properly either. https://premium.wpmudev.org/forums/topic/coursepress-pro-disable-manual-enrollment/

  • Nithin

    Hi Matthew Kilburn,

    Hope you are doing good today. :slight_smile:

    I am wanting the "Enroll Now" and/or the "Start Learning" button gone completely, turn off their display entirely.

    If I'm not mistaken, you are not looking to make use of that button at all, since you are using the automatic enroll scripts. If yes, wouldn't adding a CSS make it work?, for eg:

    .enroll-box-right {
    	display: none;
    }

    Adding the above CSS, should remove the Enroll/Start Learning button form the CoursePress page. You can add the above CSS code, using Custom CSS box(if your theme offers), or either using a Child theme, or a plugin like Simple Custom CSS.

    Your staff has assisted us with setting up code that will automatically enroll new students in all classes, so the enrollment process is unneeded. Although this code no longer seems to be working properly either. https://premium.wpmudev.org/forums/topic/coursepress-pro-disable-manual-enrollment/

    Since that thread in quite new, would recommend that you follow up the original thread, so that it will be given a closer look.

    Please let us know if you still need any further assistance. Have a nice day. :slight_smile:

    Kind Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.