Support » Plugin: s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members) » a Paypal subscription button with an actual start and end date?

Viewing 8 replies - 1 through 8 (of 8 total)
  • I have the same question. Could someone let me know if this post is still the only way to accomplish this:

    I’ve seen this question asked by many different users; I would imagine this would be a common request to have a set expiration date. Could you please let me know if this process has been added to S2M or if the process mentioned above is still the only way to make this happen?

    Thank you.

    How about trying this in your s2hacks.php file (in the mu-plugins folder):

    add_action ("ws_plugin__s2member_during_configure_user_registration_front_side", "my_fixed_EOT_time");
    add_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars", "my_fixed_EOT_time");
    add_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_modify", "my_fixed_EOT_time");
    function my_fixed_EOT_time ($vars) {
    	$expire_on = strtotime ("2015-06-30");
    	update_user_option ($vars["user_id"], "s2member_auto_eot_time", $expire_on);

    You might not want all of those actions, but I think they cover all bases.

    Thanks for your prompt response KTS915, I appreciate that! I did prepare an s2-hacks.php file with that code – with the expiration date of March 1, 2015. I’m just not sure how to test it…

    The other questions I have are:

    1. Will adding this file amend those who have already registered?
    2. Do I need to make any adjustments to the PayPal button shortcode as well?
    3. What happens when I want to start opening up registration for the next subscription cycle which starts on March 29, 2015 and ends on May 24, 2015? I imagine I can change the date in the php file after the first subscription enrollment period ends – but what if I have multiple programs running at once?
    4. Which leads me to another question: can we plug in a date and time to automatically close registration? For example this current enrollment should expire at midnight on January 3, 2015.

    I appreciate your feedback, thank you!

    You can test it by creating a new user, and seeing if the EOT gets set.

    1. It won’t affect any current users, unless they modify their subscription. If you don’t want that, you can eliminate the second and third actions.

    2. No, that’s the beauty of this code. No need to make any other changes!

    3. And that’s the problem with this method. It’s pretty inflexible. I think what’s needed is some conditional in there, but I’m not a coder so I don’t how how you could add that. (I just mine information and add it together.) Someone like krumch would be the person to ask.

    4. I use another plugin to do that sort of thing. It provides shortcodes so that you can wrap (say) the registration form and have it “disappear” on a certain date. That plugin is here.

    Thanks for your feedback. Do you know if the developers are reviewing this forum? This seems like a pretty standard request. I would like to think they could add a start and end date to these subscription codes… Again, I appreciate your help!

    Did you happen to see this post:

    This appears to have more flexibility with the start and end dates – whereas you can add those to the shortcode and keep the hacks file intact. But I’m not sure if all of the steps are listed here and if the code is still valid with the current version of S2M…

    Yes, I have seen that code, but it’s got a lot of variables that could go wrong that I wouldn’t know how to fix!

    The devs review this forum from time to time, but there’s no way to be sure they will have seen this. You could add a feature request here.

    Thank you!!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘a Paypal subscription button with an actual start and end date?’ is closed to new replies.