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™

EOT date and paypal message

s2Member Plugin. A Membership plugin for WordPress®.

EOT date and paypal message

Postby dexterinteractive » August 16th, 2010, 4:09 pm

My client has a specific date that memberships need to expire. It's an annual membership, but only if you register on day 1 of the cycle. It ends in June, so if you register in August, it's the same price but you don't get the full year, only until the end of June. I'm not sure the best way to administer this, so as not to have to touch the EOT date for each member. Another issue is that I chose the annual option in the button code, and paypal sends an email which basically says it's a year long membership ending a year from the registration date. (which likely isn't true unless they registered on July 1). What can I do here?
User avatar
dexterinteractive
Registered User
Registered User
 
Posts: 14
Joined: August 16, 2010

Re: EOT date and paypal message

Postby Jason Caldwell » August 17th, 2010, 5:11 pm

Hi there. Thanks for the great question.

Here is how I would handle this:

1. Whenever you create your PayPal® Button Shortcode, use the "Buy Now / Lifetime" option down at the very bottom of the drop-down menu. Then change the desc="" attribute in your Shortcode; removing references to "Lifetime". Then proceed to step #2.

2. Place a code snippet like this into the functions.php file for your WordPress theme:
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("YYYY-MM-DD");
      update_user_option ($vars["user_id"], "s2member_auto_eot_time", $expire_on);
   }

Just change the [ YYYY-MM-DD ] part. You could also add some conditional checks into your routine, to adjust the expiration dynamically, based on the current date, and/or any other factors that you would like to consider. If you are testing this script, you can do print_r($vars) to get a full list of ALL defined variables that you have a reference to. There are MANY of them. $vars["user_id"] is just one.
~ 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: EOT date and paypal message

Postby Cristián Lávaque » June 14th, 2011, 11:50 am

Jason, does this hack need to be updated to work with the latest s2Member? Dexter was asking me in another thread. viewtopic.php?f=4&t=10100&p=20705#p20705
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: EOT date and paypal message

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

Yes, that code should still work as expected.
Please see my reply here:
viewtopic.php?f=4&t=10100&p=20785#p20785
~ 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: No registered users and 1 guest

cron