How to enable curriculum units in course page after purchase?

Home Forums Legacy Support Support queries How-to & Troubleshooting How to enable curriculum units in course page after purchase?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #193221
    riteshsaw
    Spectator
    Hi, I want to enable curriculum units in course page itself once purchase is done. Right now I am able to enable the unit link with following functions: add_filter('wplms_curriculum_course_link','enable_course_students_view_units_curriculum'); and add_filter('wplms_direct_access_tounit','enable_access_tostudents',10,2) But the problem I am facing is that on clicking the enabled unit link it doesn't go to course status page. It goes to that unit page. I want them to directly go to course status page. Please help ASAP. Thanks, Ritesh
    #193397
    logan
    Member
    hey, for that you do not need to do hard code. please try these settings in wp-admin > lms > setting > general setting. Refer: http://prntscr.com/maklfw
    #193485
    riteshsaw
    Spectator
    Thanks ! I have already enabled those options from lms. Right now curriculum units which are completed are redirected to course status page. My requirement is that when customer purchases the course, all the curriculum units should be enabled right away and should redirect to course status page. Thank, Ritesh  
    #193551
    logan
    Member
    Hey there, disable those settings and add this code : Please paste this snippets in your wp-admin > plugins > editor > wplms-customizer plugin > wplms-customizer.php  add_filter('wplms_curriculum_course_link','enable_course_students_view_units_curriculum1226',999,3); function enable_course_students_view_units_curriculum1226($enable,$unit_id,$course_id){   $user_id = get_current_user_id();   if(wplms_user_course_active_check($user_id,$course_id)) return get_permalink($unit_id);   return $enable; }   add_filter('wplms_direct_access_tounit','enable_access_tostudents1226',999,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; }
    #193818
    riteshsaw
    Spectator
    Thanks Logan!
    #193869
    logan
    Member
    Hey, Please let me know if it works so that i can close this one.
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘How to enable curriculum units in course page after purchase?’ is closed to new replies.