Show different sidebar for non logged in visitors

Home Forums WPLMS AddOns WPLMS S3 Show different sidebar for non logged in visitors

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #155885
    Julien3z
    Participant
    Hey,   I need to use a different sidebar on course for non logged-in students , for example prices. And a different one for logged-in students with course progression (but not showing the price). I've tried to do it using this tip : https://wplms.io/support/knowledge-base/show-different-sidebars-based-on-user-login-status/ But I think i'm doing it wrong as it doesn't work. 1.I've created a custom sidebar name "loggedout" 2. I've copied the file  "wpmls-customizer" into child theme : https://prnt.sc/jfnifj 3. Then modified the customizer_class.php file as follow : https://prnt.sc/jfnhdk  3. I have found the new sidebar "loggedout" in widgets where I added a text widget. But this sidebar is not showing. Can you please help me ? Thanks a lot !    
    #156075
    Anshuman Sahu
    Keymaster
    Please try adding this code to have different sidebars on your course pages : add_filter('wplms_sidebar',function($sidebar,$course_id){   if(!is_user_logged_in()){     $sidebar = 'loggedout';   }   return $sidebar;   });  
    #156159
    Julien3z
    Participant
    Hi, Where should I add this ? In customizer_class.php?  Because that's not working... TY
    #156342
    Anshuman Sahu
    Keymaster
    nope need to add this in your wplms-customizer.php file . also there is something wrong in code ,please remove previous one and add this one :

    add_filter('wplms_sidebar',function($sidebar,$course_id){

      if(!is_user_logged_in()){

        $sidebar = 'loggedout';

      }

      return $sidebar;

     

    },10,2);

    #156502
    Julien3z
    Participant
    This reply has been marked as private.
    #156811
    Anshuman Sahu
    Keymaster
    This is custom job .Please provide some time to check this . Please ping back for a reminder.
    #156824
    Julien3z
    Participant
    Ok no problem, thanks for your update
    #157230
    Anshuman Sahu
    Keymaster
    can you please share admin credentials of your site to check this . I have ftps but cant check changes . also share url of the course . PS : mark reply as private .
    #157231
    Julien3z
    Participant
    This reply has been marked as private.
    #157405
    Anshuman Sahu
    Keymaster
    This reply has been marked as private.
    #157679
    Julien3z
    Participant
    Hi, Sorry but I don't think you have understood what I need.. I need to have different sidebars for logged out visitors and paid students. As I can see on your video, it's still the same sidebar. The same things appear. I don't get why you're saying that this is working as it is not.. Loggedout : https://prnt.sc/jkkqeu Paid students : https://prnt.sc/jkkqpv As you can see the content are the same here. For example, I don't want to show the price to already paid students "<span style="color: #d1b880; font-family: georgia; font-weight: 600; text-transform: uppercase;">49.00€ TTC PAR MOIS / 12 MOIS"</span>  
    #157902
    Anshuman Sahu
    Keymaster
    it looks like you did not see this video carefully nor you tested the functionality properly.In the beginning you can see same widget is added to both the sidebars . http://prntscr.com/jl2lls   there is another widget added for logged in users : http://prntscr.com/jl2m67   which is showing there for logged in users : http://prntscr.com/jl2n2q not for logged out  users : http://prntscr.com/jl2nws      
    #157906
    Julien3z
    Participant
    I have watched your video and tested but don't have the same results. The sidebar is the same for no loggedin and paid students - but widgets are differents. For loggedout there is no carousel vibe but that still appears. How do you explain this ? And like I asked before how can I delete the course price in widget for paid students  ? https://prnt.sc/jl2soq You did not answer that. TY
    #158108
    Anshuman Sahu
    Keymaster
    This reply has been marked as private.
    #158120
    Julien3z
    Participant
    That's perfect :) Can you please just tell me which files you have modified to do so ? And what happens when plugin/theme is updated ? Shoud I paste those field in child theme ? Thanks again !
Viewing 15 posts - 1 through 15 (of 16 total)
  • The topic ‘Show different sidebar for non logged in visitors’ is closed to new replies.