latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Modifying EOT with hook

Home Forums Community Forum Modifying EOT with hook

This topic contains 0 replies, has 1 voice. Last updated by  Adam Beaulne 3 years, 1 month ago.

Topic Author Topic
Posted: Friday Dec 6th, 2013 at 10:28 am #61717
Adam Beaulne
Username: impeka

Hi,

What I am trying to do is when a member “renews” with the modification form is add +1 year to his expiry date regardless on when he renews. The members ALWAYS expire on April 30th so I simply need to add 1 year to make it April 30th 2014, 2015, etc.

So with the following hooks

add_action('ws_plugin__s2member_during_paypal_notify_during_subscr_modify', 'update_s2_EOT');
add_action('ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars', 'update_s2_EOT');

I am doing

function update_s2_EOT($vars = array())
{
    $user_id = $vars['user_id'];

    $existing_eot_time = get_user_field('s2member_auto_eot_time', $user_id);

    $new_eot_time = $existing_eot_time;

    update_user_option ($user_id, 's2member_auto_eot_time', $new_eot_time); 
}

Obviously this isn’t adding 1 year but it’s just an example. I am able to get the user_id but the EOT variable is ALWAYS blank so after the function runs it sets my EOT for the user to empty.

Why is get_user_field(‘s2member_auto_eot_time’, $user_id); returning blank? (I can confirm that $user_id is set).

Thank you

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.