Disable Coursepress Registration Popups - Normal Pages only

I'm still waiting on a fix for the modal popups issue with Coursepress (the signup page doesn't redirect to the checkout page - see my other support ticket).

In the meantime, is it possible to disable the modal popups, so that it just uses normal pages? Could I implement a code edit of some sort that, when they click 'signup' it'll take people to the registration page, and then the checkout page, but just normal pages?

  • Predrag Dubajic
    • Support

    Hi Colin,

    Sorry that your first report is being delayed for so long, our developers are looking into addressing quite a few things for next update which is delaying release date, hopefully we will see fix for this soon.

    Can you please elaborate a bit the registration path you are looking for, after clicking on Signup button it should redirect to your custom registration page and after registration it should redirect to checkout page with that course added to cart?

    Best regards,
    Predrag

  • Colin
    • Site Builder, Child of Zeus

    Yes, thanks Predrag - I thought that if we could bypass the popups and just use normal registration pages then it might bypass the problem for now.

    Yes, exactly the path you suggest - A new visitor should arrive at the site, navigate to 'Course X' landing page, then click signup. That allows them to register, then redirects to the checkout page with 'Course X' already in the basket. Then they can purchase. Can this be done using normal non-popup pages?

    Thanks,
    Colin

  • Colin
    • Site Builder, Child of Zeus

    I'm looking at it now. I can see how the Woocommerce products could be used as the course listings. Is it possible to make the 'signup' link on the coursepress landing pages redirect to the relevant Woocommerce product page?

    And when people buy the Woocommerce course product, does that automatically enrol them on the coursepress course?

  • Predrag Dubajic
    • Support

    Hi Colin,

    This might be possible to do with a bit of jquery.

    Can you go to your wp-content/mu-plugins/ folder and create new .php file in there, name it whatever you want, and if you don't have mu-plugins folder simply create one yourself.
    Now in that file paste this code:

    <?php
    function change_button() {
    global $post; ?>
    
    	<script type="text/javascript">
    		jQuery( document ).ready(function() {
    			jQuery( ".apply-box > form > button" ).hide();
    	    	jQuery( ".apply-box" ).append( "<a href='http://domain.com/product/<?php echo $post->post_name; ?>' class='my-custom-button'>Signup</a>" );
    		});
    	</script>
    
    <?php
    }
    add_action( 'wp_footer', 'change_button' );

    From the above code replace http://domain.com/product/ with url to your single products without their slug.
    For example open your single product and the url will be something like http://domain.com/product/product-name, so simply strip product-name and use that URL.

    This code will now hide current Signup button and replace it with link to single product page.

    I have also included .my-custom-button class for that link so you can use it to style it as a button with some CSS.

    Let us know if this works for you.

    Best regards,
    Predrag

  • Predrag Dubajic
    • Support

    Hi Colin,

    Oh, html structure looks bit different than on my installation, can you try with this code please:

    <?php
    function change_button() {
    global $post; ?>
    
    	<script type="text/javascript">
    		jQuery( document ).ready(function() {
    			jQuery( ".single-course .quick-course-info > form > button" ).hide();
    	    	jQuery( ".single-course .quick-course-info" ).append( "<a href='http://domain.com/product/<?php echo $post->post_name; ?>' class='my-custom-button'>Signup</a>" );
    		});
    	</script>
    
    <?php
    }
    add_action( 'wp_footer', 'change_button' );

    Best regards,
    Predrag

  • Milan
    • WordPress Wizard

    Hello Colin,

    I've just took at look at your site's course pages source code. But I can't find code on your site loaded. Can you please tell me how you are adding code to your site ?

    Have you considered this nice plugin for managing such snippets ?
    https://wordpress.org/plugins/code-snippets/

    And what if I play around with code on your site ? Will it work ? I am asking you this because your site seems live to me so I don't want to do any testing without your permission. :slight_smile: Please advice.

    Cheers,
    Milan

  • Colin
    • Site Builder, Child of Zeus

    I'm adding it as Predrag suggested - by creating a new php file in the mu-plugins folder and adding the code there.

    But yes, you're welcome to work on that section of the website. The site is live, though, so please ensure you're always able to revert to original if everything goes wrong :slight_smile:

    I'll enable support access again.
    Colin

  • Predrag Dubajic
    • Support

    Hi Colin,

    I see jQuery(...).knob is not a function error in your console which is can be the cause of my code not working because when jquery breaks it will break other scripts on page as well.

    We had this knob issue before on Divi theme but it shouldn't be happening anymore and I'm unable to replicate it on my end as well.

    Could you try reinstalling CoursePress via FTP and see if the code works after that?

    Best regards,
    Predrag

  • Colin
    • Site Builder, Child of Zeus

    Hi, had a pause of this while trying to figure out another solution, but I'm back to it now.

    I've reinstalled Coursepress, but code still isn't working. Is there an easy way to replace this button another way?

  • Predrag Dubajic
    • Support

    Hi Colin,

    There's another way by editing plugin files but this way the changes will be gone after the update.
    If you want to try it out just download the attached file, unzip it and place it inside your /wp-content/plugins/coursepress/includes/classes/ folder and that should be it.

    Let us know if that worked.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.