PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

How are EOT's handled on multiple items per member

s2Member Plugin. A Membership plugin for WordPress®.

How are EOT's handled on multiple items per member

Postby dethier » May 11th, 2011, 10:22 pm

I just thought of this the other day and I'm wondering if you can help me understand how s2member handles EOT in the following scenarios.

First here's my setup:
Level 1 = (no purchase necessary, no EOT)
Level 2 = (purchase 1 year non-recurring subscription)
Level 3 = (purchase 1 year non-recurring subscription)
Level 4 = (purchase 1 time, no EOT)
multiple custom_caps for screening download access, each cap has various purchase prices for 1 year access to the download (non-recurring subscription). These custom_caps are all associated with the Level 1 role.

Scenario Question:
If a customer makes a purchase of one of the custom caps and then at a later date purchases another cap how will the EOT be affected? The way I want it is that the first custom cap purchased will expire 1 year from it's purchase and the second custom cap purchased will expire 1 year from it's purchase. However, it appears that s2Member will always reset the EOT for the subscription length of the latest purchase. Is that what happens?

Another related scenario:
A customer purchases a custom_cap and then at a later date purchases a level 2 subscription. My question is similar to above. How will the EOT be affected?

Thanks for any answer you can give me.
User avatar
dethier
Experienced User
Experienced User
 
Posts: 14
Joined: August 20, 2010

Re: How are EOT's handled on multiple items per member

Postby Jason Caldwell » May 13th, 2011, 4:06 am

Thanks for your inquiry.
it appears that s2Member will always reset the EOT for the subscription length of the latest purchase. Is that what happens?

Yes, that is correct. We're working to improve this in the next release or two, in order to provide further control over this behavior. Until then, you might try modifying this hack a bit to get what you need.

Create this file and directory:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_action 
('ws_plugin__s2member_during_paypal_notify_during_before_subscr_signup_w_update_vars', 'during_before_subscr_signup_w_update_vars');
function during_before_subscr_signup_w_update_vars ($vars = array ())
{
    $GLOBALS['existing_s2_eot_time'] = get_user_option ('s2member_auto_eot_time', $vars['user_id']);
}

add_action ('ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars', 'during_subscr_signup_w_update_vars');
function during_subscr_signup_w_update_vars ($vars = array ())
{
    if (($eot_time = get_user_option ('s2member_auto_eot_time', $vars['user_id'])) && $GLOBALS['existing_s2_eot_time'])
        update_user_option ($user_id, 's2member_auto_eot_time', $eot_time + ($GLOBALS['existing_s2_eot_time'] - time ()));
}
?>
* This hack is designed to extend the EOT Time instead of having it reset. So not exactly what you need, but perhaps you can tweak this a bit to get what you need until we implement new features that allow this behavioral setting from the UI panel.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: How are EOT's handled on multiple items per member

Postby dethier » May 13th, 2011, 10:12 am

Thanks Jason,
Your answer saved me digging into the code to see how things were done. Thanks VERY MUCH for the code sample as well! It gives me an idea how to setup what I need to do to get what I want to have done.

However, it looks like there is only ONE EOT variable saved with the user data. In other words, whenever a new custom capability subscription is purchased it will just replace the existing EOT with the user (either using the core code or the hack you provided to extend the time). I guess what I'm needing to do, is for custom capabilities I need to add different EOT for the user so the correct expiry date for the custom capability they purchased will be saved (i.e. they expire at different times). Does this make sense? The s2Member levels will of course have the default EOT time updated/extended but the custom capabilities need to have EOT's separate (except in my case for member level 4).

Do you have a rough idea when the modifications will be released (and by rough, I totally understand that it would be a flexible date, I know how development timelines can change)
User avatar
dethier
Experienced User
Experienced User
 
Posts: 14
Joined: August 20, 2010

Re: How are EOT's handled on multiple items per member

Postby Jason Caldwell » May 13th, 2011, 3:55 pm

You're very welcome.
Well, it *could* be as early as the next release late this month ( although not likely ). If not then, I'd look for it late June ( possibly early July ). We have several things we're working on for June that are going to revolve around the concept of Capabilities/Content Dripping and EOTs.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 1 guest

cron