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.

Show if a member has cancelled?

Home Forums Community Forum Show if a member has cancelled?

This topic contains 6 replies, has 2 voices. Last updated by  Cristián Lávaque 4 years, 8 months ago.

Topic Author Topic
Posted: Monday May 7th, 2012 at 9:28 pm #12859
Sacha Greif
Username: sachag

Is there a variable or some other way to know when someone has cancelled (but the EOT hasn’t happened yet)?

I would like to show a special (permanent) banner for these members, to let them know their cancellation has been processed, explaining why they still have access to the site and that they don’t need to cancel again.

  • This topic was modified 4 years, 8 months ago by  Sacha Greif.

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Monday May 7th, 2012 at 10:23 pm #12863
Sacha Greif
Username: sachag

Answering my own question: you can check if get_user_field (“s2member_auto_eot_time”) is defined. If it is, it means that the user has cancelled their account (correct me if I’m wrong?).

  • This reply was modified 4 years, 8 months ago by  Sacha Greif.
Posted: Tuesday May 8th, 2012 at 3:17 am #12880

Yes, your conclusion is correct for subscriptions, not buy-now payments. The subscription’s EOT will be set when the subscription ends for some reason (including cancellation), so a set EOT time for it would mean that he’s in that period between the subscription having ended and the access still not expired.

Posted: Tuesday May 8th, 2012 at 4:03 am #12888
Sacha Greif
Username: sachag

Yes, I was talking about subscriptions, sorry for not mentioning that.

Posted: Tuesday May 8th, 2012 at 4:06 am #12890

Cool. :)

Posted: Tuesday May 8th, 2012 at 4:08 am #12891
Sacha Greif
Username: sachag

As a bonus, here’s the code I’m using to find out how much time people have left before their access expires:

$current_time=new DateTime();
$eot_time=new DateTime(date('Y-m-d H:i:s',get_user_field("s2member_auto_eot_time")));
$time_remaining_before_eot=date_diff($eot_time,$current_time);
$days_remaining=$time_remaining_before_eot->days;
Posted: Tuesday May 8th, 2012 at 4:10 am #12893

Thanks for sharing it, Sasha. :)

Viewing 6 replies - 1 through 6 (of 6 total)

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.