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™

Setting EOT date on join/renew

s2Member Plugin. A Membership plugin for WordPress®.

Setting EOT date on join/renew

Postby dexterinteractive » June 9th, 2011, 12:42 pm

I think there is a way to do this using the button code, but cannot find the syntax. Currently all members
have an EOT date of 6/30/2011 - (I set this via export/import). I need this EOT date to be changed (to 6/30/2012) upon a member renewing, or a new member joining. Isn't there some way to add this as a field in the button code? Basically the membership ends on this date each year regardless of when you join.
User avatar
dexterinteractive
Registered User
Registered User
 
Posts: 14
Joined: August 16, 2010

Re: Setting EOT date on join/renew

Postby dexterinteractive » June 9th, 2011, 7:16 pm

after a bunch of searching, I finally found out how we accomplished this last year. Question is. Is this code still valid, and will it run against existing members (renewals) AND new members?

viewtopic.php?f=4&t=570&hilit=specific+EOT+date
User avatar
dexterinteractive
Registered User
Registered User
 
Posts: 14
Joined: August 16, 2010

Re: Setting EOT date on join/renew

Postby Cristián Lávaque » June 10th, 2011, 12:37 am

It may work, the hook is still in the latest version. Test it and see how it goes.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Setting EOT date on join/renew

Postby dexterinteractive » June 13th, 2011, 4:38 pm

This hook no longer works. Although should it go in functions.php in my theme? or don't you use some kind of hacks.php file?
User avatar
dexterinteractive
Registered User
Registered User
 
Posts: 14
Joined: August 16, 2010

Re: Setting EOT date on join/renew

Postby Cristián Lávaque » June 13th, 2011, 11:21 pm

You can create the directory/file /wp-content/mu-plugins/s2hacks.php and use the code there.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Setting EOT date on join/renew

Postby dexterinteractive » June 14th, 2011, 10:47 am

Still not working. Is there another way to do this?

Here is the code Jason gave me to update this last time, (and it worked in an older version)
I put it in s2-hacks.php as suggested.

Code: Select all
add_action("ws_plugin__s2member_during_configure_user_registration_front_side","my_fixed_EOT_time");

function my_fixed_EOT_time($vars)
   {
      $expire_on = strtotime("2012-06-30");
      update_user_option ($vars["user_id"], "s2member_auto_eot_time", $expire_on);
   } 
Last edited by Cristián Lávaque on June 14th, 2011, 11:48 am, edited 1 time in total.
Reason: Improve code readability. http://www.primothemes.com/forums/viewtopic.php?f=36&t=2780
User avatar
dexterinteractive
Registered User
Registered User
 
Posts: 14
Joined: August 16, 2010

Re: Setting EOT date on join/renew

Postby Jason Caldwell » June 15th, 2011, 1:17 am

Thanks for your inquiry.
~ and thanks for the heads up Cristián.

Yes, this code should still work as expected with s2Member 110606.
Please create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
    add_action
("ws_plugin__s2member_during_configure_user_registration_front_side","my_fixed_EOT_time");

    function my_fixed_EOT_time($vars)
       {
          $expire_on = strtotime("2012-06-30");
          update_user_option ($vars["user_id"], "s2member_auto_eot_time", $expire_on);
       } 
?>
If this is not working for you, please post a copy of the Shortcode that you're using for checkout.
~ 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: Setting EOT date on join/renew

Postby dexterinteractive » June 15th, 2011, 10:57 am

Here's the shortcode I'm using. I did put the code in that directory.

[s2Member-PayPal-Button level="2" ccaps="" desc="Associate Member Renewal." ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="www.website.org" ta="0" tp="0" tt="D" ra="0.01" rp="1" rt="L" rr="BN" rrt="" rra="1" image="default" output="button" /]

The price is only .01 for testing and I changed the website value for this post.
User avatar
dexterinteractive
Registered User
Registered User
 
Posts: 14
Joined: August 16, 2010

Re: Setting EOT date on join/renew

Postby Cristián Lávaque » June 15th, 2011, 8:05 pm

If the term (rt) is set to "lifetime" (L), why would s2Member save an EOT time? It's never meant to expire. WP Admin -> s2Member -> PayPal Buttons -> Shortcode Attributes (Explained) -> rt
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Setting EOT date on join/renew

Postby Jason Caldwell » June 17th, 2011, 1:17 am

Well, he is trying to do fixed EOT times, so Lifetime access is cut short by this custom script; or, it's suppose to be. I'm a little confused by this one, your Shortcode looks good, and your custom script looks good. Just to be certain, does your custom script start with <?php and end with ?>. Also, please make sure there are no extra spaces, line breaks, etc before or after <?php and ?>.
~ 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: Setting EOT date on join/renew

Postby dexterinteractive » June 19th, 2011, 5:17 pm

Yes. I double-checked the tags are there and have tested it a few more times. EOT is not updated at all. What's next?
User avatar
dexterinteractive
Registered User
Registered User
 
Posts: 14
Joined: August 16, 2010

Re: Setting EOT date on join/renew

Postby Jason Caldwell » June 20th, 2011, 5:17 am

Can you please send me a Dashboard login through this private contact form?
http://www.s2member.com/contact/
We'll take a quick look for you.
~ 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: Setting EOT date on join/renew

Postby dexterinteractive » June 20th, 2011, 10:09 am

ok. I submitted it.
User avatar
dexterinteractive
Registered User
Registered User
 
Posts: 14
Joined: August 16, 2010

Re: Setting EOT date on join/renew

Postby Jason Caldwell » June 22nd, 2011, 1:11 am

Information received, awaiting confirmation on installation domain.
~ 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: Setting EOT date on join/renew

Postby Jason Caldwell » June 24th, 2011, 12:49 am

Details received. Investigating now.
~ 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: Setting EOT date on join/renew

Postby Jason Caldwell » June 25th, 2011, 12:18 am

Investigation completed.
So sorry, I've been unable to reproduce this issue on your site. I registered a test user and the custom script did set the EOT Time as expected. Please see the User account ( jasontest ) in your WP Dashboard. If there is more information you can provide about this bug report, please let me know. Thanks!
~ 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: Setting EOT date on join/renew

Postby dexterinteractive » June 25th, 2011, 1:01 pm

hmm.. how did you 'register' that account? There is a post called 'Renew Test' that has the button code I've been using.

Try this:

1) Update your 'jasontest' user's EOT to blank.
2) then use my 'Renew Test' button (cost is only .01), and see if it updates EOT now that the member acct already exists.

Maybe the problem is that the code only works for new users? We NEED it to reset EOT for both new users and renewals.
User avatar
dexterinteractive
Registered User
Registered User
 
Posts: 14
Joined: August 16, 2010

Re: Setting EOT date on join/renew

Postby Jason Caldwell » June 25th, 2011, 8:23 pm

That's correct, the hack above uses the registration Hook, so it's only going to affect 'registrations', not modifications. The Hook is fired upon this event:
ws_plugin__s2member_during_configure_user_registration_front_side

If you want to cover all of the bases, including modifications, please use this instead:
Code: Select all
<?php
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 ("2012-06-30");
        update_user_option ($vars["user_id"], "s2member_auto_eot_time", $expire_on);
    }
?>
~ 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: Setting EOT date on join/renew

Postby Dennis Nolan » December 27th, 2011, 6:41 pm

This worked great for me. I set up a club membership that follows the calendar year regardless of signup date. I needed an eot of December 31, 2012. I just created a totally blank s2hacks.php file and dropped in the code with the end date I wanted. It works for new members and renewing members. I have S2 member pro but not paypal pro. The alternative of having to manually adjust every signup was a very distressing prospect. Of course, this limits me to only being able to sell 1 year at a time since it affects all signups, but well worth it.
User avatar
Dennis Nolan
Registered User
Registered User
 
Posts: 1
Joined: December 27, 2011

Re: Setting EOT date on join/renew

Postby Cristián Lávaque » December 29th, 2011, 4:07 am

Thanks for the feedback, Dennis. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 2 guests

cron