Remove course batches heading for non-login and non-member

Home Forums WPLMS AddOns WPLMS Batches Remove course batches heading for non-login and non-member

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #99171
    stef
    Spectator
    Hi, Is that possible to hide COURSE BATCHES HEADING for non-login user and non-member of the batches? Thanks a lot regards st
    #99302
    H.K. Latiyan
    Participant
    Ok here is what I understand from this. => You want to hide all batches from the course page for non logged in users. => If there are 3 batches in the course and the user is enrolled in only 1 batch then you want to show only that batch on the course page. screenshot: http://prntscr.com/egpqgp ------------------ Well the first part is easy and it can be done by a small php code, but the second one is not possible as there is no filter present in the file as of now. This is first time someone has requested this and therefore we had not added any filter there. However you can hide the batches list from the course page for all users from the course settings, refer: http://prntscr.com/egps35 If you want then we can add a filter there in our next update and then I can provide you  a small code which will fulfil your second requirement.
    #99957
    stef
    Spectator
    HI, I have connected batches to some courses. The member of the batch will see in the course batch header and batch description. However, non-user of the batch and non login user, only see the header: Course batches ------------------------------------- Can we remove this course batches that has no content below the header? But I do not want to remove course batches with the content - for member of the batches thanks st
    #100000
    H.K. Latiyan
    Participant
    Can you please share  a screenshot for clarifying the issue.
    #100011
    stef
    Spectator
    This reply has been marked as private.
    #100214
    H.K. Latiyan
    Participant
    This reply has been marked as private.
    #100219
    stef
    Spectator
    No, I did not put any code. I just use standard features of WPLMS
    #100237
    H.K. Latiyan
    Participant
    Please let me know which feature you used to hide the batches from non batch members.
    #100240
    stef
    Spectator
    I did not do anything.... It is hidden for non members from the beginning..
    #100453
    H.K. Latiyan
    Participant
    Then I guess you have set the batch/group as hidden, because the hidden groups are not visible to non group members. Assuming you have set the batches as hidden, try adding the bellow code in your wplms-customizer.php file present in your wplms customizer plugin OR the functions.php file of your child theme (if using a child theme): add_action('bp_after_course_header',function(){   if(is_user_logged_in()){   ?>   <script>   jQuery(document).ready(function($){     var check = $('.course_batches').find('.enrolled');     if(typeof check == 'undefined'){       $('.course_batches').hide(200);     }   });   </script>   <?php    }else{     echo '<style>.course_batches{display:none !important;}</style>';    } }); Let me know if this helps.
    #100454
    stef
    Spectator
    The code you have provided is actully hide the group above the curriculum including for the members of the group.
    #100902
    H.K. Latiyan
    Participant
    Please remove the previous code and try adding the bellow code instead: add_action('bp_after_course_header',function(){   if(is_user_logged_in()){   ?>   <script>   jQuery(document).ready(function($){     var check_batch = $('body').find('.course_batches');     if(typeof check_batch != 'undefined'){       var flag = 0;       $('.course_batches li').each(function(){         if($(this).hasClass('.enrolled')){           flag = 1;         }       });       if(flag){         $('.course_batches').hide(200);       }     }   });   </script>   <?php    }else{     echo '<style>.course_batches{display:none !important;}</style>';    } });
    #109079
    HorizonCME
    Spectator
    I have the same question as question #1 on this inquiry. I've chosen to hide the batches for guests (users that aren't logged in), but the "Batches" heading still shows up on the Course page, which is a little confusing to users. How can I hide this as well for users until they log in?
    #109252
    H.K. Latiyan
    Participant
    Hi.. Can you please share the url of the course where the batches heading is shown to non logged in users.  
Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Remove course batches heading for non-login and non-member’ is closed to new replies.