Subscription based on Invite code

Hi there,

I was wondering if anyone could point me in the right direction for my question.

I’m making my registration have a mandatory invite code. I want to be able to give different subscription options based on the invite code entered.

Cheers,

Owen

  • DavidM
    • DEV MAN’s Mascot

    Hi Owen,

    I believe that might be relatively simple, using the add_filter() function to hook into ‘membership_override_subscriptions’, which is found in:

    membershipmembershipincludesincludessubscription.form.php

    To give you a rough outline, I think you could have something like this

    function invite_subscriptions () {
    foreach((array) $subs as $key => $sub) {
    //test for invite code here and alter subscription array accordingly
    }
    return $subs;
    }
    add_filter( 'membership_override_subscriptions' , 'invite_subscriptions', 10, $subs );

    You can add your code as a separate plugin by wrapping it with the WordPress plugin header code. If this seems complicated, it’s something you’ll likely want to seek a developer’s assistance with though.

    Hope this helps!

    -David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.