How to auto assign course batches based on user role?

Home Forums WPLMS AddOns WPLMS Batches How to auto assign course batches based on user role?

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #113811
    IgnyteGroup
    Spectator
    When a user registers, I have a section where the student selects their role. There are 3 roles. I have also created 3 course batches which contain courses for those 3 user roles. Is there a way to have these course batches auto assigned to the user on registration, depending on whichever role they have selected? Thanks
    #113828
    IgnyteGroup
    Spectator
    I saw an article with this code to auto add users to free courses - function wplms_activate_free_courses($user_id = NULL){ if(empty($user_id)){ if(!is_user_logged_in()) return;   $user_id = get_current_user_id(); }   if ( bp_account_was_activated() ){ // Checks if the Account was activated $args = array( 'post_type' => 'course', 'post_per_page' => -1, 'meta_query'=>array( array( 'key' => 'vibe_course_free', 'value' => 'S', 'compare' => '=', 'type' => 'CHAR' ) ) ); $free_courses = new WP_Query($args); if($free_courses->have_posts()){ while($free_courses->have_posts()){ the_post(); $course_id = get_the_ID(); bp_course_add_user_to_course($user_id,$course_id); } } wp_reset_postdata(); } }   -------   I'm wondering if I can apply this logic to the functionality I am looking for?
    #114026
    H.K. Latiyan
    Participant
    Hi... Please confirm which registration form are you using ? Are you using buddypress registration form or wplms registration form ?  
    #114054
    IgnyteGroup
    Spectator
    Buddypress registration
    #114191
    H.K. Latiyan
    Participant
    This can be done via custom code. Let me know which profile field you have created in your website, its ID, field name and the batches that should be connected to these fields. Please explain it in details .
    #116834
    IgnyteGroup
    Spectator
    I have created a profile field called "Confirm You are a Patient" with one value, "Patient". I would like to have the batch called "Patient Courses" to be auto assigned to those users.
    #116835
    IgnyteGroup
    Spectator
    This reply has been marked as private.
    #116924
    H.K. Latiyan
    Participant
    This reply has been marked as private.
    #116926
    H.K. Latiyan
    Participant
    This reply has been marked as private.
    #116966
    IgnyteGroup
    Spectator
    If I added more fields and wanted to add different batches to them, how would I refactor the code? How do I locate the group ids?
    #117002
    IgnyteGroup
    Spectator
    This reply has been marked as private.
    #117037
    H.K. Latiyan
    Participant
    This reply has been marked as private.
    #117668
    IgnyteGroup
    Spectator
    Is there a time table on when this feature will be added?
    #117669
    IgnyteGroup
    Spectator
    If it's not anywhere in the near future, I need to be able to custom code it. This feature is necessary for my needs
    #117761
    H.K. Latiyan
    Participant
    We are hopping to release the update within a week or maximum 2 weeks.
Viewing 15 posts - 1 through 15 (of 22 total)
  • The topic ‘How to auto assign course batches based on user role?’ is closed to new replies.