redirect to course view from curriculum

Home Forums Legacy Support Support queries How-to & Troubleshooting redirect to course view from curriculum

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #130698
    dantwah
    Spectator
    Hi! I monitored how my user are using the site and it turns out they tend to buy a course using the course button but then scroll down to the page and click on the units in the course curiculum to follow the lessons. This is not that nice as when clicking on a unit on the course page does not direct you to the nice course view. Therefore, is there a way to trigger the proper course page view when someone clicks on a unit in the course curriculum on the course page.
    #130763
    H.K. Latiyan
    Participant
    Hi, By default the users cannot click on the paid units to view them even if they are subscribed in the course, so the users have to click on the course button to go to the course status page to view the course. Please check if you have enabled the setting to view the units from curriculum or added any custom code for this.  
    #130769
    dantwah
    Spectator
    Thanks for getting back. I found indeed a code snippet that allows this. What I would is that when a unit is clicked on the course page it gets loaded in the pursue course view. Is it possible by adjusting this piece of code a bit:  
    add_filter('wplms_curriculum_course_link','enable_course_students_view_units_curriculum1226');
    function enable_course_students_view_units_curriculum1226($enable){
      
    $user_id = get_current_user_id();
    $course_id = get_the_ID();
      
    if(wplms_user_course_active_check($user_id,$course_id))
    return 1;
      
    return $enable;
    }
     
    add_filter('wplms_direct_access_tounit','enable_access_tostudents1226',10,2);
    function enable_access_tostudents1226($flag,$post){
     global $wpdb;
     $user_id = get_current_user_id();
     $course_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key= 'vibe_course_curriculum' AND meta_value LIKE %s LIMIT 1;", "%{$post->ID}%" ) );
     $check = wplms_user_course_active_check($user_id,$course_id);
     if(!empty($check)){
     return 0;
     }
     return $flag;
    }
    #130850
    H.K. Latiyan
    Participant
    Hi, Sorry this is not possible as of now, you can remove this code so that the user can click on the course button to view the course in course status page.
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘redirect to course view from curriculum’ is closed to new replies.