WordPress.org

Forums

s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members)
a Paypal subscription button with an actual start and end date? (9 posts)

  1. kromes
    Member
    Posted 1 year ago #

    Is it possible to create a Paypal subscription button with an actual start and end date instead of a set duration, i.e. 5 weeks?

    https://wordpress.org/plugins/s2member/

  2. ccwadsworth
    Member
    Posted 6 months ago #

    I have the same question. Could someone let me know if this post is still the only way to accomplish this: http://www.s2member.com/forums/topic/date-based-eot-instead-of-fixed-duration/

    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.

  3. KTS915
    Member
    Posted 6 months ago #

    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.

  4. ccwadsworth
    Member
    Posted 6 months ago #

    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!

  5. KTS915
    Member
    Posted 6 months ago #

    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.

  6. ccwadsworth
    Member
    Posted 6 months ago #

    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!

  7. ccwadsworth
    Member
    Posted 6 months ago #

    Did you happen to see this post: http://www.s2member.com/forums/topic/date-based-eot-instead-of-fixed-duration/

    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...

  8. KTS915
    Member
    Posted 6 months ago #

    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.

  9. ccwadsworth
    Member
    Posted 6 months ago #

    Thank you!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic