• The user is not login, In the checkout page, he is asked for Sign in information “Email and Password” without the ability to sign in. all they have is just to place the order button

    Now I guess it is essential that user sign in before placing the order, cause What if the user have already purchased this course? He paid again and all his progress disappear

    Appreciate if there is a way to force user to sign in, if he already has an account, before place order. Or at least to show Sign-in button under sign in fields in the checkout page

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support brianvu-tp

    (@briantp)

    Hi anamostafa,

    Thank you for your valuable feedback and for highlighting this important concern.

    Currently, for paid courses, you can enable the “Keep Course Progress” feature by activating the “Allow Repurchase” option. This ensures that a student’s course progress remains intact, even if they are not logged in and click the purchase button for the course.

    If you have any further suggestions or questions, feel free to let us know.

    Best regards,
    Brianvu-tp

    Thread Starter anamostafa

    (@anamostafa)

    Thank you so much for your feedback

    Can I force the user to login before he starts or purchases the course?

    Appreciate your support

    Plugin Support brianvu-tp

    (@briantp)

    Hi anamostafa,

    Thank you for your response and for sharing your follow-up question.

    To better assist you, could you please confirm if you are using one of our premium themes, such as Eduma, or any other LearnPress-compatible theme developed by our team? The solution to force users to log in before starting or purchasing a course may vary depending on the theme you’re using.

    Once we have this information, we’ll be able to provide you with the most accurate guidance.

    Looking forward to your reply!

    Best regards,
    Brianvu-tp

    Thread Starter anamostafa

    (@anamostafa)

    Thank you Brianvu for your feedback.

    Actually I am using a premium theme from theme forest called Hub Theme

    Plugin Support brianvu-tp

    (@briantp)

    Hi anamostafa,

    Thank you for your response and for providing more details about the theme you’re using.

    To redirect users to the login page instead of the checkout page when they click the “Buy Now” button while not logged in, you can use the learnpress/rest-api/courses/purchase/redirect hook. This hook is located in the file:

    wp-content/plugins/learnpress/inc/rest-api/v1/frontend/class-lp-rest-courses-controller.php

    You can add the following code to your child theme’s functions.php file to implement this behavior:

    add_filter('learnpress/rest-api/courses/purchase/redirect', 'my_custom_purchase_redirect', 10, 3);
    function my_custom_purchase_redirect($redirect_url, $course_id, $cart_id) {
        if (!is_user_logged_in()) {
            // Redirect to LearnPress Profile page or replace with your custom login page URL
            $redirect_url = learn_press_get_page_link('profile');
        } else {
            // Redirect to checkout page if the user is logged in
            $redirect_url = learn_press_get_page_link('checkout');
        }
        return $redirect_url;
    }

    In this example, users who are not logged in will be redirected to the LearnPress Profile page (where they can log in) instead of the checkout page. You can replace learn_press_get_page_link('profile'); with the URL of your desired login page if you prefer a custom login page.

    If you need further assistance with this implementation, feel free to let us know!

    Best regards,
    Brianvu-tp

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.