CoursePress - Bug Report (maybe)

Hey Guys,
Just doing some testing on my Coursepress website. I believe I found an issue.

I was doing some testing. It was my first time running through the site as a completely new person. So it was the first run through in purchasing a course without being signed in.

When I went through the process I wasn't logged in, and the system never forced me to create an account, i went along and it let me purchase the course. But then I couldn't access the course. I thought that maybe if I then created an account using the same email they would link up but that never happened. After creating an account, my Dashboard page was just a blank page, and when I clicked on the Course that I had purchased there was no button where the Start Learning or Continue Learning button usually is.

It appeared that the system wanted me to purchase the course again to get access but obviously that is an issue.

I am using Stripe as my gateway in Test Mode, I don't think that would have a role in this but you never know.

It seems to me that the User should be forced to create an account on the site before purchasing the course.

Thanks for the help!
Tony

  • Michael Bissett

    Hey @Tony, hope you're doing well this evening! :slight_smile:

    This is definitely some curious behavior, but before we dig into this further, I noticed that you're presently running CoursePress Pro 1.2.4.3 on your site. Could you try updating to the latest version here (currently 1.2.4.6), and seeing if this issue comes up?

    If it does, then we'll dig into this further here. :slight_smile:

    Please advise,
    Michael

  • Tony

    Just wanted to write and check in on this request. I am wondering if I need to open another request or if you are seeing me post these updates? Let me know if you are getting these. My issues continue. I just updated to the next version of CoursePress and didn't see anything relating to my issue in the change log.

    The details on my issue are in my first post. I don't know how the product is even being used with the issue I am running in to. Maybe it is only with Stripe? I think for it to work CoursePress must force the course buyer to become a user before they purchase the course.

    Thanks for the help!
    Tony

  • Michael Bissett

    Hey @Tony, my apologies for the delay on this thread!

    They should have an account created for them when registering for the course, could I ask you to walk me through the process you've been using to purchase a course? I'd like to be sure that I'm attempting to replicate this on my test site properly (since you've been so patient with us here).

    Also, could you enable Support Access to your site, so that I can have a closer look at how you've got things configured here? :slight_smile:

    Thanks in advance!

    Kind Regards,
    Michael

  • Tony

    Thanks for reconnecting Michael. I am working on a deadline with this project and was thinking this post got lost in the shuffle!

    So the process that I went through is pretty straightforward.

    I logged out of the site.
    Followed the process of purchasing a course
    There were steps that asked me to login if I had an account but there were buttons available to bypass that and just purchase the course and so I did that. These options were more about Logging in with an already created account, not Create an account.
    At one point I am instructed to enter my email address into the purchasing form
    I completed my purchase via Stripe (still in test mode)
    I then get emails that I have purchased a course

    All looks good.

    But then I go to the site and have no way of accessing the course I just purchased. I tried creating an account with the email address I used but that leads me to a blank dashboard and no "Take the Course" button on the course page. In fact there is no button on that page.

    So basically I purchased the course without an account (something I can see plenty of users doing) and then there is no way for me to link that course to my account or access the course that I just purchased.

    I hope that makes sense. I have granted access. Please let me know if you have any other questions.

    Thanks!
    Tony

  • Michael Bissett

    Hey @Tony,

    No worries, it makes sense. :slight_smile:

    As you said, the user will need to be logged in to properly order the course, which we can force them to do by enabling the "Force Login" option inside of:

    Products -> Store Settings -> General

    I've just set that for you, and can confirm that it's working on my end here. Could you confirm that it's working on your end as well? :slight_smile:

    Please advise,
    Michael

  • Tony

    Hey Michael,
    Thank you for taking a look. I knew there had to be something I was missing! I did see that now during the order process a person is forced to sign up for an account.

    So the next thing.... When I follow the steps to create an account it has me enter in my Username and Email and says that it will email me a password. The page looks like just a generic Wordpress page (see attachment). The email that follows doesn't actually contain a password???

    Did you get a password in your confirmation email?

    Then I am curious... after I get the password from my email and log back in, am I going to be back in the middle of the checkout process or will I need to start over. After I go through the Registration page I am redirected to a Wordpress login page.

    Thanks so much for the help with all of this!
    Tony

  • Tony

    Hey Michael,
    Thank you for taking a look. I knew there had to be something I was missing! I did see that now during the order process a person is forced to sign up for an account.

    So the next thing.... When I follow the steps to create an account it has me enter in my Username and Email and says that it will email me a password. The page looks like just a generic Wordpress page (see attachment). The email that follows doesn't actually contain a password???

    Did you get a password in your confirmation email?

    Then I am curious... after I get the password from my email and log back in, am I going to be back in the middle of the checkout process or will I need to start over. After I go through the Registration page I am redirected to a Wordpress login page.

    Thanks so much for the help with all of this!
    Tony

  • Tony

    Sorry about the double post above! There was an error on the first post and I didn't think it made it.

    UPDATE: The email with the Password was in my Junk so I got that! However, I am still struggling a bit with the workflow and wondering how to fix things up. When I log in with my new U and P, I am redirected to the My Dashboard page which is blank. At that point I am thinking I am supposed to just restart the purchasing process???

    It isn't the cleanest workflow for new users. It would be nice if they Register and are placed back into the process as they were or at least redirected back to the start of the course purchasing process. Trying to figure out a fix or what my options are???

    Thanks again for the help!
    Tony

  • Michael Bissett

    Hey @Tony, hope you're doing well today! :slight_smile:

    Well, after a good deal of digging into this, I think I've got just what you're looking for here, with the help of a code snippet, the zM Ajax Login & Register plugin, and our PopUp Pro plugin.

    First, the code snippet. You'll want to insert the following into your site as a mu-plugin (more on how to create one here):

    <?php
    
    add_filter('register', 'incsub_custom_mp_reg');
    	function incsub_custom_mp_reg($link) {
    		if(!is_user_logged_in()) {
    			$link = '<a class="mp_cart_direct_checkout_link" href="#">' . __('Register Now To Checkout »', 'mp') . '</a>';
    		}
    
    		return $link;
    	}

    After installing the zM Ajax Login & Register & PopUp Pro plugins, you'll want to make sure that inside of:

    PopUp -> Settings

    That the "JavaScript Events" condition is enabled, we'll need this in the next step. You'll also want to set the loading method to "WordPress AJAX", if it isn't set to that already.

    As for the creating of the popup, you'll want to do the following:

    - Insert the [ajax_register] shortcode into the content area of the popup, as that's what will generate our registration form.
    - In the "Behavior" section, make sure that the "Appear when user clicks on a CSS selector", and that this is entered into the field there:

    .mp_cart_direct_checkout_link

    Make sure to check the "Repeated" box there as well.
    - In the "Form submit" section, make sure that "Refresh PopUp or close (default)" is selected.
    - Finally, in the "Displaying Conditions (optional)" section, make sure that the "Visitor is not logged in" condition is enabled.

    Once you've done all this, you should now have a fully functional popup registration form for MarketPress. :slight_smile:

    Let me know if this helps please! :slight_smile:

    Kind Regards,
    Michael

    P.S. Credit to my colleague @Jack Kitterhing for the code snippet he shared here:

    https://premium.wpmudev.org/forums/topic/change-register-link-in-marketpress-when-forced-login#post-740723

  • Tony

    Hey Michael,
    So I think that I completed all the steps with no luck. I did modify your code as I figured you missed the end tag for the php. So I added ?> to the end of the code. At that point the site showed a number of header related warnings (see below). So something isn't working??? Can you take another look and advise. I will ensure that you can get into the site as well.
    Thanks!
    Tony

    P.S. Doesn't this seem like something that should be baked into the plugin? Might be a good addition for the next update.

    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home4/corridor/bmcacademy/wp-content/mu-plugins/registration-popup.php:12) in /home4/corridor/bmcacademy/wp-content/plugins/coursepress/coursepress.php on line 153

  • Michael Bissett

    Hey @Tony,

    Actually, the lack of a ?> on the end there was intentional, as it's not required here. :slight_smile:

    For this situation, I'll need you to send in the following, so that I can dig into this further for you:

    - Mark to my attention, the subject line should contain only: ATTN: Michael Bissett
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - Include WordPress admin access details (login address, username & password)
    - Include FTP log-in details (hostname, username & password)
    - Include any relevant URLs for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    https://premium.wpmudev.org/contact/

    In regards to this:

    Can you tell me are these changes set up such that when I make updates to my site and plugins my changes will be saved?

    Yep, since we're not editing any of the plugin files here, we don't have to worry about having to reapply the code when the plugin is updated. :slight_smile:

    Kind Regards,
    Michael

    P.S. On this:

    Doesn't this seem like something that should be baked into the plugin? Might be a good addition for the next update.

    I do agree that it'd be an interesting feature to have. :slight_smile:

  • Tony

    Hey Michael,
    Thanks so much for the help with all of this. It looks like it is working great! After looking at things more closely I am sure that my issues were presented because I choose to use the MP shortcodes and styling over coursepress. I just had better luck getting the courses to display and list how I wanted them with the MP shortcodes.

    If in the next version the manual coursepress page is more editable and functional than I will likely switch back over. The display on that page isn't bad but I don't like the sidebar and I don't like the super short text description. With the sidebar there if I run a sale the sale price is cut off from view. I just couldn't make it look right.

    I am thinking I am all set. I have one other little cosmetic issue that I will start a new thread for.

    Thanks again for the help with this!
    Tony

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.