Take this course button for free courses and visitors

Home Forums Legacy Support Support queries How-to & Troubleshooting Take this course button for free courses and visitors

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #35151
    Juippi
    Spectator
    Hi, I'm trying to change the link of TAKE THIS COURSE button for
    • free courses and
    • non logged in users
    to registration page. So instead of /?error=login I would like it to be /register/ I tried the filter solution proposed in the several threads add_filter('wplms_take_course_button','custom_non_loggedin_user_redirect',10,2); function custom_non_loggedin_user_redirect($html,$course_id){ ....... However this solution did not work. The TAKE THIS COURSE button still had the original link. I have purged the cache in my browser and website.
    #35247
    H.K. Latiyan
    Participant
    The code below works fine: 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; } Refer: http://prntscr.com/ad36ae Please check you are using this code and putting it in the wplms-customizer.php file. Also change the link from localhost to your website.
    #35266
    Juippi
    Spectator
    Can't get it to work... followed the instructions to the letter. Can you take a look? Login: vibethemes Password: @1SuperP@ssword https://kahvitauko.fi/wp-login.php An example of a free course can be found: https://kahvitauko.fi/course/nettisivujen-luonti-omalle-koneelle/
    #35324
    Juippi
    Spectator
    Solved... don't really know what did it but now the button works.
    #35433
    H.K. Latiyan
    Participant
    Ok Thanks for confirming. It might be due to some caching I guess. So marking the topic as resolved and closing the topic.
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Take this course button for free courses and visitors’ is closed to new replies.