KC s2Member ccap clock timer


The WordPres plugin s2Member® has its own "scripting language" of several []-tags. One (and maybe most used) tag is [s2If …] [/s2If], where we can set conditionals to show or hide content, functions etc, depending of the privileges of the current viewer, like this:

[s2If current_user_can(access_s2member_ccap_may2012)]
for everyone who has ccap "may2012".
[/s2If]

Although this is very useful and versatile, there are times when you might want to give access to multiple pieces of content that will have different ccaps (so they might be sold separately) based on when the member makes the purchase. This is currently not possible with the basic ccaps from s2Member® as the only timestamp available is based on the level registration, meaning when a member gains access to Level 1 or Level 2, and even then, there is no way to compare the ccap to give partial access based on that timestamp.

Here is a scenario to illustrate what we needed. You have a monthly magazine that can be purchase every month. You set a ccap for each issue, like mag201201 (for the January issue), mag201202 (for the February issue) and so on. If a subscriber wants to purchase a single issue of the magazine, it is no problem to add the particular ccap in the Paypal button or the pro-form. However, you might want to offer a monthly subscription to the magazine where the customer will pay today, and then be granted access to all the issues AFTER TODAY. The long way would be to go in the user profile and add mag201210, mag201211, mag201212, and so on, but if you have to edit each subscriber’s profile, every month, it is not convenient at all. If you were to protect all the issues with one single ccap, like “magazine”, and use a conditional like this:

[s2If current_user_can(access_s2member_ccap_magazine)]
Content for everyone who has ccap "magazine".
[/s2If]

Then you run into another problem: the subscriber who pays in October would also be granted access to the issues from before the start of the subscription. Not logical either. So we needed a way to use the time of registration as a way to determine if one issue is accessible or not. This is how this function will work.

This tool will allow you to insert a specific code into the Paypal button or the pro-form that will create a custom ccap based on the time of the transaction, no matter what level it is, no matter if the user was a registered member (but not subscribed to that particular product). Then, with a shortcode or a PHP code (your choice, may need to set another plugin to run PHP inside the post/page), you will add a conditional that will return “true” if the “timestamp ccap” is before a specific date.

Going back to our magazine example, it means that the site owner can now sell individual issues with a standard ccap associated with it, but also allow subscribers to join at any time, and get access to the issues AFTER the registration timestamp. So if the subscriber is assigned a ccap like mag201209 (meaning he purchased the subscription in September), the particular issue can be protected with this shortcode:

[s2If kc_magazine_check(201209)]
for everyone who has a ccap of 201209 or before meaning they purchased the subscription in September or before.
[/s2If]

This is a functionality that is not offered by s2M, and allows you more flexibility. This can be used for magazine issues, classes, workshops, samples, etc.

With some editing, you can create various such ccaps to suit your particular needs. You can also use the year only, the year and month, or the year, month and day if you have products that are based on another schedule than a monthly subscription. The details for editing and creating your own ccaps are included in the instructions that come with your purchase.

Disclaimer: I am in no way associated with s2Member®, Webshark or the development team of s2Member®.

Purchase Options:
Kit - installation guide, code etc. - 15 USD
Kit + installation and some customization - 35 USD
Kit + installation and heavy customization - 60+ USD

You must log in or create account to purchase this kit.

This entry was posted in WP+s2M Content Drip and tagged , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply