[CoursePress Pro] MarketPress not updating with CoursePress items

I have been trying to get Coursepress to work properly. I have a sample free and paid course created. I wanted to test coursepress pro by enrolling myself as a regular subscriber.
I got to the course details page and while it said price: free, it used the add to cart button, then when I clicked on add to cart, the cart page popped up and said nothing was in the cart. This is an infinite loop and I don't know where to start to look for this.

  • Kasia Swiderska
    • Support nomad

    Hello Holly ,

    I can see that you have customized the course-content-overview.php template by adding add to cart button in the code:

    <div class="quick-course-info cus_quantity">
    <?php
    //echo "join button code begin";
    mp_buy_button(true, 'list');
    //echo "join button code end";
    ?>
    </div><!-- quick-course-info -->

    Can you tell me if you got that code from us or did you found this snippet somewhere on the forum?

    kind regards,
    Kasia

  • Patrick Freitas
    • Staff

    Hi Holly

    Hope you are doing well.

    The issue is the mp_buy_button(true, 'list'); from course-content-overview.php.

    Using the default MarketPress file or direct from MarketPress Product we can add the Course on Cart correctly.

    I tried to create some new function and call the plugin on a different way but it didn't work, I will be escalating this to our Second Line Support.

    Once the Second Line Support replies to the Ticket you will get an e-mail notification.

    Best Regards,
    Patrick Freitas

  • Tho Bui
    • Staff

    Hello Holly,

    In this case, you can try this snippet code:

    if( class_exists('CoursePress_Helper_Integration_MarketPress') ){
    	$product_id = CoursePress_Helper_Integration_MarketPress::get_product_id( get_queried_object_id() );
    	$shortcode = sprintf( '[mp_buy_button product_id="%s"]', $product_id );
    	echo do_shortcode( $shortcode );
    }

    I updated the code in the course-content-overview.php template file.

    Kind Regards,
    Tho Bui

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.