[Membership 2] Expire when the first one

We would like to know if we can implement this requirement in any way.
We have a main paid membership. When the user buys it, he gets the chance to see and subscribe to other free and unlimited memberships.
We would like that when the first paid membership expires, the other memberships (possibly subscribed by the user) will also expire.

Thank you

  • Nithin
    • Support Wizard

    Hi Akama_MU,

    Sorry for the delay in getting back to you. I'm checking with our SLS team regarding the status of the issue and will get back to you once we get further feedback asap. In general, all members can go to the/membership page to view all the available memberships, and manually subscribe to free memberships. However, automatically expiring other membership when the 1st paid membership expires requires a custom workaround.

    Will keep you posted once I get further update regarding this asap. We truly appreciate your patience regarding this. Have a nice day ahead.

    Kind Regards,
    Nithin

  • Panos
    • SLS

    Hi Akama_MU !

    I have prepared a mu-plugin that should allow only one Membership to be available when a member registers (in the Memberships List page). He will see the rest of the memberships listed there only after subscribing to the main one. Once the main one gets expired/cancelled then it will remove all the rest memberships.

    Not sure how close this is to what you need, hope it is very close :slight_smile:. If you would like to test it out, you can download the mu-plugin from here :
    https://gist.github.com/wpmudev-sls/5af42dac7bd929e00ce209fdf07e9eca
    unzip it and open file : ms-set-master-membership.php with a text editor. There find this line :
    const MASTER_MEMBERSHIP = 46;
    and change the number 46 with the id of the Membership you want to use as your main one. Once done, save and upload this file to your wp-content/mu-plugins folder. If that folder doesn't exist you can simply create it.

    How to test.
    1. After uploading the mu-plugin you can try registering a new user using Membership's Registration page. You should notice only the Main membership available

    2. Once user is registered to the Main one, you can visit the Memberships List page where you should see the rest of the Memberships available too. Subscribe to a few more, so that test member should have several subscriptions.

    3. It's time to check what happens when the Main Membership gets expired/cancelled. You can change the Subscription ( of the Main Membership for that user ) from the admin Membership 2 > All Members and choose the test member. From there change the dates to the past in order to check the expiration case or change the status to Expired. Then save

    Let us know how it goes.

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.