Hi there,
we have been aware of this issue for a long time and have not been able to fix it ourselves. We were waiting for a fix in the code but perhaps we are just doing something wrong.
Looks like all of our course Units can be accessed from the outside world, that is from non members and people not enrolled in a course.
All is needed is for someone enrolled in the course to share the links to the units.
Will send details in private message.
Cheers
This reply has been marked as private.
This reply has been marked as private.
hi and thanks for the code.
Just to be clear though, our units are not free. They are parts of paid courses. That is the reason I reported this is a problem!
People who have not purchased the courses, can still see the units, if given the link!
@italymadeeasy
Thanks for reporting this bug.
Even after adding the code, it is visible?
Hi Diana,
I have not tried the code yet.
I was only responding to your comment about:
<span style="color: #4b4d4d; font-family: Lato; font-size: 14px; background-color: #e8e8e8;">The alternative is, do not make your units free. But if your units are free, then this code will work and restrict the access</span>
I assumed that, if you said that, you were assuming that we had set our units as FREE, but we have not!
@italymadeeasy
Okay,
Please try the code and Let me know
Hi I have exactly the same problem.
Is this solved , if so i need the solution too please.
My courses are all linked to woocommerce products and MyCred payment. However all the videos in the units are visible, the pdf is not,
Kindly advice asap
This reply has been marked as private.
@zatakk,
Please add the below code in wp-admin > Plugins > Editor > Select WPLMS Customizer Plugin > wplms-customizer.php
//redirect single units for non logged in users
add_action('template_redirect','redirect_single_units');
function redirect_single_units(){
if(!is_user_logged_in() && is_singular('unit')){
wp_redirect('link');
exit();
}
}
Replace the link with the link where you want to redirect the page when non students access the page
This code will restrict the non logged in members to access the units directly.
Please check this code. Create your own topic and then Let me know whether it works or not
Hi Thanks
The issue is resolved.
Regards
Zatakk