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.

Different Demotion Level After a Refund

Home Forums Community Forum Different Demotion Level After a Refund

This topic contains 7 replies, has 3 voices. Last updated by  Grace Solivan 4 years, 10 months ago.

Topic Author Topic
Posted: Tuesday Feb 28th, 2012 at 7:41 am #6659

Hi there

Currently when a user expires membership they are demoted to Subscriber/free level.
I’d like Refund demotions to demote to a Banned level instead.

Is this possible? Where do I edit for that?

-grace

  • This topic was modified 4 years, 10 months ago by  Grace Solivan.

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Wednesday Feb 29th, 2012 at 12:07 am #6717
Staff Member

Hi Grace. Thanks for your inquiry.

Sorry, what do you mean by a “Banned Level” please?

Posted: Wednesday Feb 29th, 2012 at 2:55 am #6737

So you want a custom behavior for the EOT triggered by a refund, right? Instead of the demotion to Level 0 or deleting the account, you want to assign them a different role, is that it?

If that’s the case, then no, it’s not possible with s2Member as it is, although maybe Jason knows a hack for that, but it is something that we plan to have included in the next major release of s2Member.

Posted: Wednesday Feb 29th, 2012 at 6:10 am #6754

We are a video chat community – so if someone is banned from the system we track those bans. Its easiest to assign bans to a level of their own where they cannot access anything. Our Banned Level is a custom Role.

Thanks Cristian.

Posted: Thursday Mar 1st, 2012 at 7:48 am #6879
Staff Member

Hi Grace. Thanks for the follow-up.

I’m not sure if it will help you, but s2Member does make a Filter available that allows site owners to define a custom Role of their choosing, which is used to force a different Role upon any demotion by s2Member’s EOT System.

Hack Instructions:

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
( these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins )

<?php
add_filter("ws_plugin__s2member_force_demotion_role", "my_demotion_role");
function my_demotion_role($default = "subscriber")
	{ return /* I say it is... */ "banned"; }
?>
Posted: Thursday Mar 1st, 2012 at 8:05 am #6880

Thank you Jason! :)

** Can this be specific enough so that only ipn-refund-reversals get force demoted to that role?
Not all demotions – like expiry – would be banned.

-grace

Posted: Thursday Mar 1st, 2012 at 11:28 pm #6944
Staff Member

Hi Grace. Thanks for the follow-up.

Yes, but you would actually need a completely different hack to accomplish that.

Create this directory and file instead please.
/wp-content/mu-plugins/s2-hacks.php
( these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins )

<?php
add_action("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_before_demote", "my_eot_demotion_role");
function my_eot_demotion_role($vars = array())
	{
		if($vars&#91;"eot_del_type"&#93; === "ipn-refund-reversal-demotion")
			$vars&#91;"__refs"&#93;&#91;"demotion_role"&#93; = "banned";
	}
?>
Posted: Friday Mar 2nd, 2012 at 6:53 am #7051

So fantastic! Thank you Jason –
am trying it now. :)

-grace

Viewing 7 replies - 1 through 7 (of 7 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.