Memberhsip Trials without payment gateway

I want to offer a free trial for my memberhsips, and I don't want to get any user's information at the initial sign up.
I only want them to enter their credit cards/PayPal after the trial period is done. I wanted to use the Trial Addon, but it's asking for the payment info before the trials finishes.
So now I'm using a memberhship that's free and lasts 3 months which is the trial period. I would like to know if it's possible to limit it so a user can sign up for that membership only once, and then if they want, access to the content, they need to join the other remaining paid memberhsips.

  • Panos

    Hi Dr. Berge ,

    This is not supported by the plugin as the trials are handled by the payment gateways. Only workaround would be to use two different memberships.

    The first membership should act like a trial membership. It should :
    a. Be Free
    b. The "Access Structure" option set to " Finite Access"
    c. In the "Grant access for" set the period that the trial should end
    d. In the "After this membership ends" choose to change to your second Paid membership.

    For the second membership you can set it as you want. For both memberships you need to set the Protection Rules separately.

    With the above workaround, a member would signup for the trial membership (eg "My membership Trial" ) for free and will have access. Once the period passes, he will no longer have access. In his account page he will see that he has a pending membership that he can choose to pay or cancel.

    One thing that I suppose you might need is to display only the Trial memberships in your memberships list page. You can exclude memberships from list with the following snippet:

    add_filter( 'ms_model_membership_get_signup_membership_list', function( $memberships, $exclude_ids, $only_names ) {
    
    	$more_excluded_ids = array( 5112, 6139 );
    	$exclude_ids = array_merge( $exclude_ids, $more_excluded_ids );
    
    	foreach( $memberships as $key => $membership ) {
    
    		if( in_array( $membership->id, $exclude_ids ) ) {
    			unset( $memberships[ $key ] );
    		}
    
    	}
    
    	return $memberships;
    }, 20, 3 );

    You will need to replace the membership ids in line:
    $more_excluded_ids = array( 5112, 6139 );
    with your membership ids you need to exclude. Make sure you separate them with a comma.

    You can add this snippet in a mu-plugin. If you are not familiar with mu-plugins you can read more about them here:
    https://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/

    Hope this helps :slight_smile:

    --NOTE--
    There has been a recent release of Membership plugin including several fixes and improvements. One change that needed to be done was to rename the plugin's folder name to membership-pro. After upgrading plugin you will probably have to re-activate.

    Thanks!

  • Dr48

    Hi Panos,

    That's fantastic!!

    Thank you very much -- I was unaware that I could set it up this way.

    Being unfamiliar with the mu-plugin options, I entered the above code into 'snippets' and its working -- great! (hope this is all okay)..

    Prior to the update of the plugin, I noticed the 'homepage slider' (home to the Membership display, also) had been hidden -- BUT there was a WONDERFUL easy and simple layout of the 'sign up' to the free membership! Once the update was done, it reverted back -- the slider is now visible AND the single membership option as well -- but not as it 'was' i.e. it is displaying as it was previously (i.e. how all three memberships were displayed) opposed to the simple display (which I loved).

    However, I have no idea how this was done! May I please ask you to guide me to display the membership as so, so users who see the 'homepage' can simply sign up (i.e. the form was in sight/displayed) -- the only difference would be that for the slider/deader to be restored (i.e. currently it is showing, again, though it wasn't when the form was displaying).

    I sure hope it is easy to get back as I really loved the look of it!

    Thank you again Panos for your help, I really appreciate it!

  • Dr48

    Sie note: the 'other' 2 memberships are not displaying once a user is logged in (i.e. to upgrade/sign up to) -- query is, how can they 'choose' between the 2 'other' memberships (after the free trial)? The FREE membership has been set to upgrade to one of them -- but they 'other' one is then not visible -- it would be nice for the 2 options to be displayed as a choice AFTER the user has signed up to the free trial i.e. so once a user is logged in, these option would feature in their account, or the output in the membership list for available memberships (currently once logged in, it simply shows the free membership).

    Thank you again Panos!

  • Panos

    Hi Dr. Berge ,

    There are several different issues mentioned here, I will try to reply to them all and apologize in advance if I miss anything.

    Being unfamiliar with the mu-plugin options, I entered the above code into 'snippets' and its working -- great! (hope this is all okay)..

    Not sure what snippets is. Do you mean functions.php file of your theme? It should be ok there, but if you are not using a child theme this file will be replaced with new one on theme update. I believe it's worth having a look on what mu-plugins are:
    https://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/
    as they are really useful for such customizations :slight_smile:

    Sie note: the 'other' 2 memberships are not displaying once a user is logged in (i.e. to upgrade/sign up to) -- query is, how can they 'choose' between the 2 'other' memberships (after the free trial)?

    This part is not very clear:

    query is, how can they 'choose' between the 2 'other' memberships

    I now understand that you want to have 2 paid memberships. In such case you can add 2 Trial memberships too. For example:
    Trial One membership > After expiration will create a subscription for "Paid Membership One"
    Trial Two membership > After expiration will create a subscription for "Paid Membership Two"

    However if you want to display the memberships to logged in users, open to edit file that contains the previous snippet, and right after line :

    add_filter( 'ms_model_membership_get_signup_membership_list', function( $memberships, $exclude_ids, $only_names ) {

    in order to show all memberships if user is logged in, add:

    if( is_user_logged_in() ){
    		return $memberships;
    	}

    OR, in order to show all memberships to logged in users that have a membership already:

    if( is_user_logged_in() ){
    		$current_member = MS_Plugin::$api->get_current_member();
    		if ( $current_member->has_membership() ){
    			return $memberships;
    		}
    	}

    Prior to the update of the plugin, I noticed the 'homepage slider' (home to the Membership display, also) had been hidden -- BUT there was a WONDERFUL easy and simple layout of the 'sign up' to the free membership! Once the update was done, it reverted back -- the slider is now visible AND the single membership option as well -- but not as it 'was' i.e. it is displaying as it was previously (i.e. how all three memberships were displayed) opposed to the simple display (which I loved).

    I am not sure about the slider. The class of the slider element is bb-slider-container and in theme there seems to be an option for Homepage Slides which contains the same slides. You can try disabling this option from you theme:
    yoursite.com/wp-admin/admin.php?page=boss_options

    The memberships are probably hidden because of the script I provided. You can either try the modification I proposed above or comment out the snippet completely to see if this restores them to how they were.

    At this point point I notice that when I am in your home page, if I click on the "Sign Up" button of the free membership it redirects me to the home page again. It seems that there is some other custom script causing the redirect.In case you were not familiar about this and want us t check it out, please create a new thread about this as it is hard to keep up with different issues in a single thread.

    Membership2 login not working

    I tried to log in here: yoursite.com/account/ and yoursite.com/login which I see the Membership login form and I was able to login. If I am missing something could you please create a new thread about this including what I need to do to replicate this on your site ?

    date of birth field turned off but still unresponsive

    You mean it has issues as mentioned in your other thread some while ago, or you want to remove it? If you need to remove it you can do that from Membership > Settings : yoursite.com/wp-admin/admin.php?page=membership2-settings&tab=profilefields. If there is some other issue could you please explain in a new thread?

    Apologies for asking different threads for everything. It's more clear for us to follow up and for future reference! I hope I covered some of the issues here and didn't miss something important :slight_smile:

    Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.