Member within two Access Levels/Subscriptions

Hello,

I have the following case.

I use a login via Facebook and asign the user a free membership, which gives him access to some sites, but restricts the access to Site “paid Site”.

Then if he signs up for the subscription “Paid Subscription” he is then member of both free and paid subscription.

Now my problem. He has then no access to the “paid Site” because his membership in “free member” does not allow him to access the site.

“free member” and “paid member” works against each other.

How can I solve the problem, that “free member” has no access and “paid member” has access.

Thanks in advande.

  • Jack Kitterhing
    • Code Norris

    Hi there @michael

    I hope you are well today and thank you for your question.

    The current beta within this thread here https://premium.wpmudev.org/forums/topic/all-attached-below-is-the-beta-of-version-345 should resolve this, though please be advised that is beta software and isn’t a final release.

    I’d recommend installing it on a test site first and then checking it and if it works correctly as you want, then upload to your live site :slight_smile: And take a backup of your site how it currently is.

    Thank you!

    Kind Regards

    Jack.

  • Michael
    • Flash Drive

    Hi,

    thanks for the quick responds.

    I have installed the beta version, but do not see a difference. Do I

    need to set up sth. differently?

    I have Access Level “Free” which has a negative rule for Site “Paid” and

    Access Level “Paid” a negative rule for Site “Free”. I do not see a

    change. I can not view both sites, if the member is asigned to both.

    Do I need to do it differently?

    Thanks in advance.

    Mike

  • Michael
    • Flash Drive

    Hi Jack,

    The membership site is http://www.eltrendo.com and the login is just via FB Login on the right site possible.

    I have set up 3 Access Levels: No Member, FB Member, Video Access.

    “No Member” – are all members who are not logged in.

    “Fb-Member” – when you log in, is this the level the user gets assigned to automatically.

    “Video Access” – the user needs to purchase this level under the menu “EW Webinar” –> “Erwerben”

    The problem occurs when a user buys access to “Video Access” and is then member of “FB-Member” and “Video Access”

    I do not have set any positive rules only negative as they are shown in the screenshots. But to put it simple, I have three “EW Webinar” pages/menu which have different content for “No-Member”, “FB-Member” and “Video Access”.

    The two access levels which have no access to the page have negative rules on it.

    Screenshots:

    Access Levels: http://666kb.com/i/cfv1uws64ak9kxpm4.png

    No-Member (Negative Rule): – Page: http://666kb.com/i/cfv1vq8aburuwamek.png

    – Menu: http://666kb.com/i/cfv1w425bv0flj018.png

    FB-Member (Negative Rule): -Page: http://666kb.com/i/cfv1wq0jl7ldgey24.png

    – Menu: http://666kb.com/i/cfv1x1nwpd15vl6ng.png

    Video-Access (Negative Rule): – Page: http://666kb.com/i/cfv1xnfw7c8bhi224.png

    – Menu: http://666kb.com/i/cfv1xvur1vzbxwt0s.png

    If you want me to add to your user the “Video-Access” Level, just let me know.

    Kind Regards

    Mike

  • Jack Kitterhing
    • Code Norris

    Hi there Mike,

    I hope you are well today, sorry for the extreme delay with my reply, I have just sent you an email, if you could add the Video-Access subscription level to my user please so I can test further :slight_smile:

    Thank you for your patience and sorry again about the delay.

    Kind Regards

    Jack.

  • Jack Kitterhing
    • Code Norris

    Hi there Mike,

    Thanks for the additional info I have flagged the lead developer on this issue.

    @Barry Facebook login is being used here and once logged in they get the free access, but then if the they subscribe to the paid subscription, the still keep free access, but because of this, the rules are conflicting and blocking access to the paid subscription areas.

    Thanks!

    Kind Regards

    Jack.

  • Barry
    • DEV MAN’s Mascot

    If it isn’t important to have a member on both levels, you could add a bit of code to your site to remove them from the “free” level when they sign up for the “Paid” level.

    It’s a simple bit of code, if that sounds like something that would work?

  • Michael
    • Flash Drive

    Hi Barry,

    Thanks for the reply.

    It does not sound that clear to me. How is it technically possible to remove a user from the “free” level and he is then still in both levels?

    The main issue now is that the user pays with PayPal and needs to wait until I remove him manually from the “free” level. This should be done automatically so the user gets access immediately. This is step one.

    But for the future I plan several “paid” levels. How does this work? The user can get level “1 paid” and “2 paid” with different content or both levels. But when he purchases both, then there is probably a conflict.

    Thanks for the help in advance.

    Regards

    Mike

  • Barry
    • DEV MAN’s Mascot

    It does not sound that clear to me. How is it technically possible to remove a user from the “free” level and he is then still in both levels?

    He wont be in both levels – I thought (from reading above) that you wanted a user who signed up via facebook to have a Free susbcription until they signed up to a Paid one. So, with this idea – as soon as they sign up to a Paid subscription, they will be removed from the Free subscription.

    The main issue now is that the user pays with PayPal and needs to wait until I remove him manually from the “free” level. This should be done automatically so the user gets access immediately. This is step one.

    Yes, that’s what I suggested above.

    But when he purchases both, then there is probably a conflict.

    We’re running tests on this functionality in the Beta thread at the moment.

  • Michael
    • Flash Drive

    Wow, this was a fast respond =) Thanks!

    Correct, this would solve my problem for now. If I can implement the code, a code would work.

    Several paid subsrcriptions is in plan, but not right now implemented. When is this planned to be in the plugin?

    Thanks!

  • Barry
    • DEV MAN’s Mascot

    Wow, this was a fast respond =) Thanks!

    Late night coding :slight_smile: Always more productive when it’s quiet…

    Can you let me know the id of your “Paid” subscription? You can get this by clicking on the Edit link of the subscription, and it will be in the URL address – sub_id = x

    I assume you have the Free subscription set in the Membership -> Options page? If so, then I can write the code to grab the id of the subscription to leave from there.

  • Michael
    • Flash Drive

    Hi Barry,

    thanks for the code. After I implemented the code it gives me an error in the header:

    When I login or logout it gives me the following error:

    “Warning: Cannot modify header information – headers already sent by (output started at /eltxvmxg/www.eltrendo.com/wp-content/themes/business-feature/functions.php:329) in /eltxvmxg/www.eltrendo.com/wp-login.php on line 368

    Warning: Cannot modify header information – headers already sent by (output started at /eltxvmxg/www.eltrendo.com/wp-content/themes/business-feature/functions.php:329) in /eltxvmxg/www.eltrendo.com/wp-includes/pluggable.php on line 697″

    These are just two errors out of many but they are all saying the same.

    When I am correct I need to copy your whole code including “<?php” at the beginning till the end “?>” I pasted the code at the end of the funtions.php file. I removed the one bracket at the end, where you had one too many.

    Normally this should be it, correct?

    Thanks in advance.

    Regards

    Mike

  • PC
    • WPMU DEV Initiate

    Hello Michael,

    Thanks for posting back.

    I implemented the code in the middle of the file with own php tags. The site now works without an error message, but does not drop the member :disappointed:

    Let me try and get Barry back on this thread. He should be here sooner than later.

    Cheers

    PC

    Sales &Support

  • Barry
    • DEV MAN’s Mascot

    The easiest way to see if this is working / being fired is to add a couple of lines to send you an email when it reaches certain points – they can then be removed later on.

    Between line 7 and 8 add:

    wp_mail('myemail@mydomain.com', 'Here from paid sub', 'I have been fired by the paid subscription');

    and then between 12 and 13:

    wp_mail('myemail@mydomain.com', 'Found Free sub', 'I have found the free subscription');

    I’ve updated the pastebin script here:

    http://pastebin.com/KNrewArH

    You need to change the email address to your own one.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.