Hi, I have a site thats sells language lessons.
The lessons are for members only and members have to pay a subscription fee.
Now everything works just fine except that Im having troubles with setting the lesson pages permissions.
In this page below you can see all the lessons.
Each one of the Images is linked to a lesson.
Now when a user clicks on a lesson I want:
1) First, when a user pays for subscription his ID and his Email are inserted to a "Paid members" collection.
2) Then I added a code that checks if the current user is logged in as a member.
This is the code I wrote:
3) If the user is logged in, I want to run a query that checks if the currrent user ID and Email are exists in the "Paid members" collection.
4)If the user exists in the collection I want him to be redirected to the lesson he clicked on. If he dosen't exist I want to show a lightbox that says that this is a member only content.
For now with this code the query doesn't seem to work.
I would really appreciate if you could help me with setting this up.