How to hide free sections and units for course students

Home Forums Legacy Support Support queries How-to & Troubleshooting How to hide free sections and units for course students

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #312452
    ateya3d
    Spectator
    Hello how can i hide free sections and units for course students that already subscribed to this course if user subscribe to course all free will be invisible to him ... how can i do this ? i use version 3.9.9
    #312462
    MrVibe
    Keymaster
    Please clarify the request. You want to hide the free 1. We have free units and First section free. So when you say free section do you mean the first section free feature ? 2. When you say hide, you want to remove them from the curriculum, so the user will not see it, which means it is a different curriculum for the course. or you just want to hide the term "free" ? We will need to do a feasibility check, if this is possible in the 3.9 framework or now.
    #312515
    ateya3d
    Spectator
    Thanks for your reply i know my request may be not requested before .. in sample words .. i want free units and free sections appear only for guests and non subscribed users to course .. if any one subscribe to course all free not visible to him and only found the non free sections and lectures
    #312765
    Diana
    Participant
    For part 1, we have this setting in v3: https://wplms.io/support/knowledge-base/guest-user/ But for this: "if anyone subscribe to course all free not visible to him and only found the non-free sections and lectures" Need to check in the code
    #333022
    ateya3d
    Spectator
    Diana 4 month to check the code ??? this is very terrible follow up for your support Reply with the problem solving
    #333049
    Diana
    Participant
    I am really sorry sir, it just slipped from my mind. But please from the next time do ping on your topics as a reminder Will post here in 3 hhours
    #333052
    ateya3d
    Spectator
    @Dina When we post to ping the support says please don't pump your post OK i will wait for the next 3 hours as you say
    #333073
    Diana
    Participant
    This reply has been marked as private.
    #333081
    ateya3d
    Spectator
    Hello Diana can you give me the final code to hide To hide “free Units” from Subscribed users and i will use it and tell you the results give me the code and i add it in my functions.php
    #333243
    ateya3d
    Spectator
    can i get a reply Diana ???? why all this delay ??
    #333274
    MrVibe
    Keymaster
    ok, I am sharing based on following assumptions as details are missing in the topic above : 1. We are talking about the Course page here. The curriculum which shows on the course page. 2. We are not talking about guest user feature. -- Any user who subscribes to the course should not see "Free" unit direct links int the curriculum. --- code in next reply.
    #333278
    MrVibe
    Keymaster
    add_filter('bp_course_get_full_course_curriculum',function($curriculum,$course_id){
    
    	if(is_user_logged_in() && bp_course_is_member($course_id,get_current_user_id())){
    		foreach($curriculum as $i=>$link){
    			if(!empty($link['link'])){
    				$curriculum[$i]['link']='';
    			}
    		}
    	}
    
    	return $curriculum;
    },10,2);
    This code will work in version 3 sites and will remove all links from the curriculum for any user who is subscribed to the course.
    #333320
    ateya3d
    Spectator
    This reply has been marked as private.
    #333565
    Diana
    Participant
    Posting in 2 hours
    #333572
    Diana
    Participant
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 17 total)
  • The topic ‘How to hide free sections and units for course students’ is closed to new replies.