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.

I am novice and need help with custom cap

Home Forums Community Forum I am novice and need help with custom cap

This topic contains 2 replies, has 3 voices. Last updated by  cassel 2 years, 12 months ago.

Topic Author Topic
Posted: Friday Jan 10th, 2014 at 10:10 am #62551

I’ve been trawling through the guides and forums but cannot find an answer I can understand and put into action. I desperately need some help.

In short, I have three courses. Each is independent from the other and needs to be paid for separately. I also have an option to buy all three for a reduced price. I don’t want incremental levels. I don’t want level two subscribers (course 2) to be able to see course one (level 2). I don’t want level three to have access to 2&3. Level four should give access to all the three courses below.

I have read the guidance on the s2 support and watched the video but I don’t understand it.

The example code they provide – do I just cut and paste it or does it need modifying and tailoring to my site? Where do I actually paste this to? Is it on each individual page with content protection?

Has anyone already done this and if so, would you be kind enough to post the code and let me know where I need to put it.

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Friday Jan 10th, 2014 at 4:11 pm #62553
surya s
Username: surya

have u tried to use these

[s2If current_user_is(s2member_level4)]
    Some premium content for Level 4 Members. (paste ur course data here) in between the short codes
[/s2If]

[s2If current_user_is(s2member_level3)]
    Some premium content for Level 3 Members.
[/s2If]

[s2If current_user_is(s2member_level2)]
    Some premium content for Level 2 Members.
[/s2If]

[s2If current_user_is(s2member_level1)]
    Some premium content for Level 1 Members.
[/s2If]

[s2If current_user_is(s2member_level0)]
    Some content for Free Subscribers.
[/s2If]

[s2If !current_user_can(access_s2member_level0)]
    Some public content.
[/s2If]
Posted: Saturday Jan 11th, 2014 at 11:19 am #62572
cassel
Username: cassel

You can use the levels like that or you can call the course something else, just so you don’t get confused with the levels which are, by default, incremental.
So you can call them Course1, Course2, Course3 and those would be the custom capabilities (ccaps).

The simplest way to protect the content is with the little box on the top right when you add a page or a post, where it says “Require Custom Capabilities?”. There, you would enter Course1, or Course2, etc.

If you want/need to use conditionals instead, it could look like this

[s2If current_user_can(access_s2member_course1)]
    Display the content for Course 1
[/s2If]
[s2If !current_user_can(access_s2member_course1)]
    Display information about the course, and direct them to register for it, so it could even be a sale page at the same time
[/s2If]

So your purchase button would have something like this for single course:

[s2Member-PayPal-Button level="1" ccaps="course1" desc="First course" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="yoursite.com" ta="0" tp="0" tt="D" ra="10" rp="1" rt="L" rr="BN" rrt="" rra="1" image="default" output="button" /]

but the bundle would be coded like this:

[s2Member-PayPal-Button level="1" ccaps="course1,course2,course3" desc="Bundle of all 3 courses" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="yoursite.com" ta="0" tp="0" tt="D" ra="10" rp="1" rt="L" rr="BN" rrt="" rra="1" image="default" output="button" /]

Would that work for you?
I am using that all over my own site, and it is easy enough to manage once you understand that basic.

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