I was setup wplms with myCred means that user can take the course using Mycred Point.
The problem is if user go to course detail and click "Take This Course" without login, then it will be error "insufficient"
How to setup, if user not login then click "Take This Course", there will be a display error Please Login to Continue.
or is it possible to redirect to register page if user not login and click it?
Thanks
Please try adding this code in your wplms-customizer.php file present in your wplms customizer plugin.
add_filter('wplms_take_course_button_html','custom_non_loggedin_user_redirect',10,2);
function custom_non_loggedin_user_redirect($html,$course_id){
if(!is_user_logged_in()){
$extra ='';
$register_page='http://localhost/wplms/register';
return '<a href="'.$register_page.'" class="course_button full button">'.apply_filters('wplms_take_this_course_button_label',__('TAKE THIS COURSE','vibe'),$course_id).apply_filters('wplms_course_button_extra',$extra,$course_id).'</a>';
}
return $html;
}
NOTE: Please change the $register_page link to your register page link.
Thanks for confirming.
So marking the topic as resolved and closing the topic.