How to use constant in s2If

Hi

I’d thank you any idea to build a simgle cancelation link usefull for Stripe or Paypal.

I have Paypal and Stripe and I’d like to knwo how to use S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY in combination with s2If to manage wich cancelation link is shown.

I have been searching in forums a couple hours and I haven’t been able to find it.

Thank you

Try this:

[s2If ([s2Get constant=“S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY” /] = ‘Paypal’)] You use Paypal [/s2If]

I am not tested it, tough…

Thanks for the idea… I have tried this


Hello

[s2If ([s2Get constant=“S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY” /] = ‘Paypal’)] You use Paypal [/s2If]

World

But it returns a blank page.

Can’t tell you more.

Use this on the page:

Hello
[s2If kc_s2if_php_test()] You use Paypal [/s2If]
World

and in the “mu_plugins/s2hacks.php”

function kc_s2if_php_test() {
	return eval('return ('.trim(do_shortcode('\'[s2Get constant="S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY" /]\' == "paypal"')).');');
}

THANKS!!!

It was too difficult for me

THANKS A LOT!

You are welcome :slight_smile:

I was curious to see how to hack it…