Home › Forums › WPLMS AddOns › WPLMS S3 › Show different sidebar for non logged in visitors
- This topic has 15 replies, 2 voices, and was last updated 6 years, 6 months ago by Anshuman Sahu.
-
AuthorPosts
-
May 9, 2018 at 11:15 am #155885Julien3zParticipantHey, 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 !May 10, 2018 at 2:31 pm #156075Anshuman SahuKeymasterPlease 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; });May 11, 2018 at 8:26 am #156159Julien3zParticipantHi, Where should I add this ? In customizer_class.php? Because that's not working... TYMay 12, 2018 at 9:24 am #156342Anshuman SahuKeymasternope 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);
May 14, 2018 at 8:04 am #156502Julien3zParticipantThis reply has been marked as private.May 15, 2018 at 2:50 pm #156811Anshuman SahuKeymasterThis is custom job .Please provide some time to check this . Please ping back for a reminder.May 15, 2018 at 4:00 pm #156824Julien3zParticipantOk no problem, thanks for your updateMay 17, 2018 at 2:41 pm #157230Anshuman SahuKeymastercan 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 .May 17, 2018 at 2:46 pm #157231Julien3zParticipantThis reply has been marked as private.May 18, 2018 at 2:53 pm #157405Anshuman SahuKeymasterThis reply has been marked as private.May 21, 2018 at 9:36 am #157679Julien3zParticipantHi, 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>May 22, 2018 at 10:40 am #157902Anshuman SahuKeymasterit 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/jl2nwsMay 22, 2018 at 10:50 am #157906Julien3zParticipantI 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. TYMay 23, 2018 at 2:07 pm #158108Anshuman SahuKeymasterThis reply has been marked as private.May 23, 2018 at 2:31 pm #158120Julien3zParticipantThat'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 ! -
AuthorPosts
- The topic ‘Show different sidebar for non logged in visitors’ is closed to new replies.