Home › Forums › Chit Chat › WPLMS customizations › Tip – Open login popup when user try to see free units
Tagged: free unit, login popup, signup
- This topic has 10 replies, 7 voices, and was last updated 8 years, 10 months ago by vipsindia.
Viewing 11 posts - 1 through 11 (of 11 total)
-
AuthorPosts
-
December 14, 2015 at 10:37 pm #13877thexlearnerSpectatorHello, Today I will see you guys how you can show the login form when the user try opening a free unit so you can attract the users to signup . 1 - Add this code in wplms customizer plugin :
add_filter('wplms_curriculum_course_lesson','wplms_free_access_2',99,3); function wplms_free_access_2($html,$lesson,$course_id){ if(!is_user_logged_in()){ $free=get_post_meta($lesson,'vibe_free',true); return '<a class="button_trig_login" href="#">'.get_the_title($lesson).(vibe_validate($free)?'<span>'.__('Gratuit','wplms_modern').'</span>':'').'</a>'; }else{ return $html; } }<code></code>
2 - Now add this code in your wplms -> footer -> google anaylitics :jQuery("document").ready(function($){ $(".button_trig_login").on('click',function(event){ event.preventDefault(); $('a.smallimg.vbplogin').trigger('click'); }); }); <code></code>
Credits : - Restricting non-logged in user to see the free unit - button to open the login popup of default theme Hope this helps Regards, The x LearnerDecember 18, 2015 at 8:46 pm #14609learner4lifeParticipant@thexlearner thanks for this wonderful tip! Works like a charm. Can you also please suggest me if there is a way to do that same for clicking on embedded images?. That is, upon clicking an image, a non logged in users, instead of going to the image url, goes to the pop-up login window?December 18, 2015 at 8:59 pm #14611learner4lifeParticipantEven embedded videos? That would be pretty cool!December 18, 2015 at 10:23 pm #14620thexlearnerSpectatorSorry I don't know how to do it for videos and imagesDecember 22, 2015 at 5:07 am #15039MrVibeKeymasterThis tip is awesome.January 11, 2016 at 3:08 pm #17903julianocustodioSpectatorNice tip, I was looking for it. I have two ideas. 01- Is there any possible way that we can do the poupup like a "light box"? I mean, to highlight the form. Should be nice if the poupup algin center 02- Is it possible to create a new page layout and insert the register form above the login form? Please, see the image attached. Do you do freelancer? Cheers.January 11, 2016 at 6:41 pm #17922[email protected]SpectatorYou mean like this? http://beta.kursaronline.com.br/curso/basic-of-nature-photography/ If so implementing the modern login should accomplish both. Hope it helps youJanuary 25, 2016 at 11:40 am #20641DavidParticipant@urdek I loved the way you did with hover effect on courses images. You show the name of instructor, star rating, that's awesome. You used some javascript to do that? Can you share how you did?February 2, 2016 at 5:11 pm #24529[email protected]SpectatorThis was working fine (thank you, thexlearner) before the latest updates, but for it to work with the newest modern theme (diplaying unit description) I had to change a bit. Here's the code I'm using should it help anyone://Login popup on Free Lessons add_filter('wplms_curriculum_course_lesson','wplms_free_access_2',99,3); function wplms_free_access_2($html,$lesson,$course_id){ $free=get_post_meta($lesson,'vibe_free',true); if(!is_user_logged_in() && vibe_validate($free)){ return '<a class="login_trig" href="#login">'.get_the_title($lesson).'</a>'; }else{ return $html; } }
February 2, 2016 at 5:14 pm #24530[email protected]Spectator@David Sorry for the delayed response, I wasn't tracking this topic...just came here to update the code in case anyone attempt to use this tip with the latest release. It's all css...use opacity to hide/show it on mouse hover, pretty straight forward. Take careFebruary 4, 2016 at 6:15 am #25122vipsindiaSpectatorplease update the code.... -
AuthorPosts
Viewing 11 posts - 1 through 11 (of 11 total)
- The topic ‘Tip – Open login popup when user try to see free units’ is closed to new replies.