latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

trial membership and auto upgrade after time

Home Forums Community Forum trial membership and auto upgrade after time

This topic contains 7 replies, has 3 voices. Last updated by  Raam Dev 4 years, 5 months ago.

Topic Author Topic
Posted: Thursday Jul 12th, 2012 at 10:03 am #19038

Hi,

Before buying I would like to know if the following membership-scheme is posible:

A customer would have the ability to try the membership for 7 days, he will not be charged for the first 7 days and can download 3 downloads in total. If he wants to continue he is charged x amount automatically after 7 days and gets unlimited downloads for a year (recurring))

How to do this?
Is this posible with the free versions or only with Pro?

Another related question:
How do I make a monthly recurring membership with a limit of 5 downloads a month?
In Paypal Buttons I can charge x amount monthly but
in Basic download restrictions I can allow 5 downloads every 30 days (only in days? / 30 days is not a month)
Can I instead allow 5 downloads every 1 month?

Thanks for your help!

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Thursday Jul 12th, 2012 at 12:17 pm #19047
Eduan
Username: Eduan
Moderator

Hello Dehaas,

I believe this can’t be done just like that, but there is a workaround:

Register the user as a free member (level 0) and only allow him the amount of downloads you want in the trial.

Then, offer a subscription button so that the user can upgrade to the next level, at which he will be able to download the amount of downloads you wish for the paid member.

And of course, you can configure 30/31 days, I believe there currently isn’t a way to use months instead of days, so you will have to use the nearest amount you wish in days.

Hope this helps. :)

Posted: Friday Jul 13th, 2012 at 12:18 pm #19176

Hmmmm, like this the user is not going to pay automatically after 7 days which it should,
would this be an option to workaround:?

“A customer would have the ability to try the membership for 7 days, he will not be charged for the first 7 days and can download 3 downloads in total. If he wants to continue he is charged x amount automatically after 7 days and gets unlimited downloads for a year (recurring))”

-Offer a Membership with 3 downloads / 7 days
-Paypal button: Offer first 7 days for free and than charge 50 dollars / year

-After 7 days automatically show a button (using S2MEMBER_CURRENT_USER_REGISTRATION_DAYS for example)
to CHANGE the 3 downloads / 7 days INTO unlimited downloads?

Is it posible to change a users “downloads / days” like this? (for example through custom capabilities?)

Thanks for your help, i appreciate it!

Posted: Saturday Jul 14th, 2012 at 5:50 am #19223
Raam Dev
Username: Raam
Staff Member

Hi Dehaas,

Here’s what you can do:

Go to Dashboard -› s2Member® -› Download Options -› Basic Download Restrictions.

– Configure Level 0 to allow 3 Downloads every 7 days.
– Configure Level 1 to allow 999999999 Downloads every 365 days (unlimited downloads).

Now, on your downloads page, you will need to use Advanced PHP Conditionals (Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals) and Advanced PHP Constants (Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants) to check a few things:

<?php if (current_user_is("s2member_level0") && S2MEMBER_CURRENT_USER_REGISTRATION_DAYS > 7){ ?>
	This will show if the current user is a free member AND they have been registered for more than 7 days
	This is where you would put the message about upgrading to a paid membership.
	You would need to show a Subscriber Modification button here:
	Dashboard -› s2Member® -› PayPal® Buttons -› Subscr. Modification Buttons
<?php else if (current_user_can("access_s2member_level1") || S2MEMBER_CURRENT_USER_REGISTRATION_DAYS < 7) { ?>
	This is where you show the downloads.
	Users who are Level 1 (i.e., paying members) OR free users who have been registered for less than 7 days, will see the downloads.
	Level 0 (free) members will only get 3 downloads and Level 1 members will get unlimited downloads.
<?php } ?>

You will need to put this code on your downloads page. To use PHP code in WordPress Posts/Pages, you will need to install the Exec-PHP Plugin.

Posted: Tuesday Jul 17th, 2012 at 10:04 am #19516

Thanks for the help I think this is the way foreward.
However in this way the customer still is not automatically billed after 7 days (he has to click the Subscriber Modification button). I want him to be billed automatically after 7 days, this is what I did now:

– Configure Level 1 to allow 3 Downloads every 7 days. (he gets first 7 days for free, after he is billed 50 dollar)
– Configure Level 2 to allow 999999999 Downloads every 365 days (unlimited downloads) (Normally costs 50 dollar)

<?php if (current_user_is("s2member_level1") && S2MEMBER_CURRENT_USER_REGISTRATION_DAYS < 7){ ?>
You are in trial period
<!--This will show if the current user is a member level 1 AND they have been registered for less than 7 days, he is in the trial period and did not pay yet, and has 3 downloads for 7 days.-->

<?php } else if (current_user_is("s2member_level1") && S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 7 { ?>
<!--This will show if the current user is a member level 1 AND they have been registered for more than 7 days, he has passed the trial period did pay 50 dollar but still has 3 downloads for 7 days. Now he gets a Subscriber Modification button to upgrade to level 2 which also costs 50 dollar (No extra costs only change in membership level)-->

Your trial period is over and you can upgrade for free to a Unlimited membership by clicking the button below
(BUTTON)				

<?php } else { ?>
Some public content.
<?php } ?>

This works, however you can understand it is not a realy fancy solution as the customer is directed to Paypal to change subscription/payment details although he already paid; this is confusing.

My question: Is it possible to create a button that only changes the s2membership (from level 1 to level 2) without being redirected to Paypal and having to change payment details?

THANKS for your help!!

Posted: Wednesday Jul 18th, 2012 at 4:12 am #19585
Raam Dev
Username: Raam
Staff Member

Hi Dehaas,

My question: Is it possible to create a button that only changes the s2membership (from level 1 to level 2) without being redirected to Paypal and having to change payment details?

Unfortunately it’s not possible to create a free upgrade from one level to another using the Pro-Forms. If you want to do that, you’ll need to implement some custom PHP code that changes the users role from s2member_level1 to s2member_level2 using the WordPress remove_role() and add_role() methods. See this link for an example of how these WordPress methods are used.

If you’re not comfortable with PHP, we recommend posting your job on jobs.wordpress.net.

Posted: Wednesday Jul 18th, 2012 at 6:17 am #19605

Great thats just what I needed,
I have put this code on the Login Welcome Page so when the user logs in after 7 days and still is s2member_level1 he gets automatically upgraded to s2member_level4.
(Offcourse I could also check if he has paid at that time but I suppose this is handled by paypal/s2member)

This is the code i use:

<?php if (current_user_is("s2member_level1") && S2MEMBER_CURRENT_USER_REGISTRATION_DAYS < 7){ ?>
You are in trial period
<!--This will show if the current user is a level 1 member AND they have been registered less than 7 days
The user is in trial period: the first 7 days are free, after that a recurring anual x dollar-->
<?php } else if (current_user_is("s2member_level1") && S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 7){ 
$u = wp_get_current_user();
// Remove role
$u->remove_role( 's2member_level1' );
// Add role
$u->add_role( 's2member_level4' );
?>	 
					
You have been upgraded to Platinum Member!!!!
					
<!--This will show if the current user is a level 1 member AND they have been registered 7 or more days
The user has passed trial period; paid x dollar recurring anually, and gets automatically upgraded to level 4-->

<?php } else { ?>
		Some public content.
<?php } ?>

I appriciate your help!

Posted: Wednesday Jul 18th, 2012 at 10:12 pm #19698
Raam Dev
Username: Raam
Staff Member

Fantastic, thank you for sharing that code, Dehaas!

Awarded Dehaas Koenraad the Helpful badge.
Viewing 7 replies - 1 through 7 (of 7 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.