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.

Paypal Unsubcribe for Free Membership?

Home Forums Community Forum Paypal Unsubcribe for Free Membership?

This topic contains 3 replies, has 2 voices. Last updated by  Alec Weekes 3 years, 11 months ago.

Topic Author Topic
Posted: Saturday Jan 19th, 2013 at 4:15 am #38303

Hi
I have included the paypal Unsubscribe button on my Login Welcome Page, and have a question about its functionality. Can someone who has signed up for Free Membership rather than Paid Memebership use this button to unsubscribe?
Thanks

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Saturday Jan 19th, 2013 at 5:49 pm #38344

Greetings Elizabeth,

Offering an unsubscribe button for your members is a good practise, and many members may choose to leave your membership services, and won’t have any hard feelings if you’ve made the process simple and easy to do!

That said, your current system will show the unsubscribe button to everyone, and that isn’t the ideal thing to do. People who are not subscribed may click the button, and be presented with a whole load of errors, or taken to a series of pages that are not relevant to them at all!

This’ll make the user feel as if the site is unreliable and isn’t fit for purpose, which is obviously off putting. The best thing to do is to protect content, and ensure it is displayed to the correct people, and you can do this easily with PHP Else If Conditionals.

Here is a sample code.

<?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 1){ ?>
    [Place Unsubscribe Button Here]
<?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 0){ ?>
    Some content for Free Subscribers.
<?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === -1){ ?>
    Some public content.
<?php } ?> 

Allow me to explain what each part does;

<?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 1){ ?>
    [Place Unsubscribe Button Here]

This will check with your database, the s2Member Installation and other necessary services to see if the user is able to access s2Member Level 1 or higher (Greater then). If they can, it’ll show certain content.

In this case, you’ll place your button here, so that anyone who is Membership Level 1 (or higher) will see the unsubscribe button.

<?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 0){ ?>
    Some content for Free Subscribers.
<?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === -1){ ?>
    Some public content.
<?php } ?> 

Exactly the same as above, it’ll check the systems you have in place, and if the person matches the information, it’ll show the content they’re designed to see.

You could add a WP_Redirect into the Public Content Section so that they’re redirected away from the Welcome Page, or you could have some marketing blurb about joining your membership club.

With the Free Subscribers section, you could do some marketing about why they should join your membership club, along with a button to do so.

Using this system, you’ll be able to target content specifically to people based on their level, along with many other factors, when coded correctly.

I hope this has helped!

Posted: Sunday Jan 20th, 2013 at 6:24 am #38400

Hi Alec

Thanks for your detailed response. It makes sense, but also makes me realise how much I need to learn about getting my site to work the way I need it to. For example, I don’t even know where to place the sample code you gave me – is it on the page?

I’m keen to teach myself (I’m familiar with HTML, and comfortable with that, so am confident I can learn) – but don’t know where to find guides/tutorials to help me. Can you suggest anything?

Elizabeth

Posted: Sunday Jan 20th, 2013 at 9:17 am #38407

Good morning Elizabeth,

Teaching yourself any coding language takes time, so don’t feel the need to rush into it. Learning one language though, really helps you understand them all, as the theory behind them is almost identical, but the implementation is different.

As for the code, you can either build a whole new WordPress Php Template for the Welcome / Login Page specifically, or you can use a plugin to allow PHP to work from the Post / Page Visual Editor.

Check out this plugin: http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/

This’ll allow you to put the code above, into any page or post. Simply put it in place of your current unsubscribe button. If you have any issues with the code, let me know and i’ll do testing and debugging on my website to assist you.

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