• Resolved kunalkothari1810

    (@kunalkothari1810)


    when i click the preview lessons which are kept for public it is redirecting again to the course page .. it works when i enroll in a membership plan
    but ideally it should not happen , preview lessons are for demo purpose it should be visible to everyone ,

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jason Coleman

    (@strangerstudios)

    Thanks for reaching out. Sorry you’ve run into this issue. It seems the Tutor LMS module for our PMPro Courses add on does not check for those “preview” lessons.

    We would need to update our code around here to account for that. I’ll reach out to the team and see what we can come up with. In the meantime, a work around is to create a copy of the course that is public and has copies of the preview courses available to the public.

    Another option if you are a developer, would be to unhook our template redirect method there and code up your own.

    I think we should try to fix this use case in our plugin, but I wanted to give work arounds so you don’t have to wait on us. These fixes can sometimes take a while.

    Thread Starter kunalkothari1810

    (@kunalkothari1810)

    can you guide me a little i will edit the code and apply the code snippet ?

    Plugin Author Jason Coleman

    (@strangerstudios)

    We are working on a fix in PMPro Courses. It should be ready in a week or so.

    In the meantime, here is a gist that hooks into a filter in PMPro Courses and overrides that redirect_to if the current $post is a lesson and a preview. The main idea here is to set the $redirect_to to null so it doesn’t redirect.

    https://gist.github.com/ideadude/1f1b17491f16eca1359a66644fcd58fe

    I am unsure if this is the correct code to detect a preview, because I don’t have a copy of the Tutor LMS add on to make preview lessons, but it seems like Tutor stores that info in that post meta field. There may be other issues with the code as I did not test it, but this is the general idea to fix this.

    Let us know if it works.

    Because there have not been any recent updates to this topic, we will be changing the status to resolved. If you have any new questions or if your issue persists, please feel free to create a new topic.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘plugin redirecting to course page when clicked preview coruses’ is closed to new replies.