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.

Membership Upgrade Questions

Home Forums Community Forum Membership Upgrade Questions

This topic contains 3 replies, has 3 voices. Last updated by  Bruce 3 years, 6 months ago.

Topic Author Topic
Posted: Friday Jun 21st, 2013 at 12:47 pm #52343
Chase Rief
Username: riefmedia

Hi, i have a question regarding the membership upgrade process.

I have a website with 2 paid membership types (Basic and Premium), along with the default free type. The membership fee is paid via PayPal, auto-recurring and the duration is 1 year.

What happens if a member signs up for a Basic Account, and after 3 months he decides to switch to the Premium type? I have an upgrade form setup, but i am unsure on what happens on the upgrade – does the Basic Membership ends after just 3 months and the Premium Membership starts right away for the following year?

If so, and considering the example above, the member will lose the 9 months of paid membership (basic type)?
Or is the membership type switched to Premium, and the EOT extended with another year (the EOT being, in this case, 1 year and 9 months of Premium Subscription)?

In the first case, the members would lose money, in the second i risk to have members sign up for basic, then upgrade to Premium and get 9 extra months of premium content for the basic money.

Thanks a lot for any answer or advice!

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Saturday Jun 22nd, 2013 at 6:56 pm #52394

When you sell a user a second subscription, the first one is ended by s2Member and the new one started. s2Member just charges what you entered in the shortcode for the subscription being sold, it won’t calculate time left from the previous subscription. So what you need to do in such case, is have a bit of PHP to figure out the time he has left from the first one, calculate how much that means in money, and discount it from the first payment in the new subscription. You can do this using the initial term, then regular payments are at the normal rate.

These should help:
http://www.s2member.com/kb/using-variables-in-a-shortcode
http://www.primothemes.com/forums/viewtopic.php?f=36&t=15889&p=53557#p53346
http://www.primothemes.com/forums/viewtopic.php?f=36&t=15889&p=53557#p53418
http://www.s2member.com/forums/topic/recurring-prorating-of-billing/#post-7410

Posted: Thursday Jun 27th, 2013 at 8:31 am #52675
Chase Rief
Username: riefmedia

Hi Cristián – thanks for your answer.

I actually did something similar to what you suggested, “patching” the upgrade shortcode with the new price.

On the upgrade page, i have two links, each one sending a different “?upgrade_to” parameter (basic / premium).

Below is the PHP code used to calculate the refund value / discount based on the remaining subscription months.

$upgrade_to = htmlspecialchars($_REQUEST['upgrade_to'], ENT_QUOTES, 'UTF-8');
$expiration_date = get_user_meta($current_user->ID, 'wp_s2member_auto_eot_time', true); 
$remaining_months = -1;
$curr_mem_type = get_current_user_role(2);


if (current_user_is("s2member_level1")) $curr_level_price = 450;
if (current_user_is("s2member_level2")) $curr_level_price = 995;


$today = time();

while($today < $expiration_date)
{
   $remaining_months++;
   $today = strtotime("+ 1 month", $today);
}


switch($upgrade_to) {
	case "basic":
		$desired_mem_type = "BASIC Membership";
		$desired_level_price = 450;
		$memlevelid = 1;
	break;
	case "premium":
		$desired_mem_type = "PREMIUM Membership";
		$desired_level_price = 995;
		$memlevelid = 2;
	break;
}

$refund_value = round ($curr_level_price / 12 * $remaining_months, 2);
$upgrade_price = $desired_level_price - $refund_value;

And this is the shortcode used:

<?php echo do_shortcode('[s2Member-Pro-PayPal-Form modify="1" level="'.$memlevelid.'" ccaps="" desc="Total Charge: $'.$upgrade_price.' USD" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="'.$_SERVER['HTTP_HOST'].'" ta="0" tp="0" tt="D" ra="'.$upgrade_price.'" rp="1" rt="Y" rr="0" rrt="" rra="2" accept="paypal,visa,mastercard,amex" accept_via_paypal="paypal" coupon="" accept_coupons="1" default_country_code="US" captcha="0" /]'); ?>

However, i have a question – if i set the payment recurring (“rr” = 1), and the “ra” (payment value) attribute is discounted above to a lower value than my desired annual subscription – what happens in this case after one year?

For example, the annual fee for premium membership is $995, but due to discounts applied, the “RA” value will be $300. Which will be the amount auto-billed at the end of the time period: $995 or $300?

I’m asking because i would like to have the client auto-billed, but at the regular annual value, not at the discounted price.

Can I setup the discounted payment value as a “trial” payment (“TA = 300”), and then the full value as the regular price (“RA = 995”), with “RR = 1”?
In the case above, after the initial “trial” year expires, the user’s paypal will be auto-charged at the full rate?

Thanks a lot!

Posted: Friday Jun 28th, 2013 at 5:36 am #52715
Bruce
Username: Bruce
Staff Member

For example, the annual fee for premium membership is $995, but due to discounts applied, the “RA” value will be $300. Which will be the amount auto-billed at the end of the time period: $995 or $300?

The recurring amount is based on this amount, so if you discount the RA amount, it will stay that way for the duration of the subscription.

Can I setup the discounted payment value as a “trial” payment (“TA = 300″), and then the full value as the regular price (“RA = 995″), with “RR = 1″?
In the case above, after the initial “trial” year expires, the user’s paypal will be auto-charged at the full rate?

This is exactly what you’d want to do. You set up a trial period (of 1 year in this case) at the discounted rate, and then after the trial ends the User will start being charged at the regular price for the duration of the subscription.

Hope that helps :-)

Viewing 3 replies - 1 through 3 (of 3 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.