Restriction Conflicts and Workaround

I’ve read the potential conflicts with restrictions:

The last paragraph says it: you CANNOT restrict a page with both membership and/or specific page access. Meaning, if you plan on selling access to one page or post, you can’t sell it as part of a membership.

According to this thread, you would have to duplicate the page, one for members, and one you can sell individually.

Now, here’s my question:

I have a websites with tens, possibly growing to hundreds of pages. I want to sell access to each page as individual products. But I also want to sell a membership that grants members access to ALL pages with an “all-access pass”.

However, cloning that many pages seems redundant, repetitive, and cumbersome.

Question: other than cloning, is there a better way to do this? TIA.

1 Like

Hi Michel.

Sure, that’s not a problem if the user has an account on your site. Then you can sell the pages individually with custom capabilities. See: WP Admin > s2Member > API / Scripting > Custom Capabilities

The Specific Post/Page restriction is to sell access to a page without requiring the person to login because the URL itself has the access credentials.

Does that help? :slight_smile:

Hmm, still a little confused. In the video, he requires level #1 or higher, and requires capabilities a and b. So does one supersede the other? Meaning, if I give custom capability requirement “a” for example, that’s in addition to being a member level #1? Or said differently, a member with an all-access pass can access this page, as well as people who bought that page only (capability “a”)?

The confusion is the s2member restrictions box on the side of the post: is it one or the other? Or is it AND the other?

Sorry if this is apparent, it’s just not clear to me.

1 Like

You could apply a CCAP to each page, but that would also become cumbersome as you would need to use simple conditionals to set an OR condition on the post or page if you don’t want to create a separate copy. Any way of individually restricting single posts and pages, especially retroactively, is going to be time-consuming — keep in mind that you also have to have a button or form to actually sell all of these pages. I haven’t tried every membership plugin out there, but I don’t know of any that will automagically restrict posts/pages so that they can be sold individually and create a sales method after the fact. There might be one out there that can intrinsically use ORs so that you can sell a single page both individually and as part of an all-access membership since that at least seems reasonable. Someone else might know of one such.

1 Like

The confusion is the s2member restrictions box on the side of the post: is it one or the other? Or is it AND the other?

No, that box’ restrictions are all applied, not one or the other.

Like Pat said, you’d need conditionals, and it’ll be quite a bit of work to sell them if you do them all one by one, too.

I still think it’s doable in a simple way with a bit of custom code. You could have the conditional using the page’s ID to name the ccap, for the restriction and to sell it.

So, for example, if it’s page/post ID 123, you could name the ccap access_s2member_ccap_p123 dynamically.

$ccap = 'access_s2member_ccap_p'.$post->ID;

Then have a conditional that checks the user’s access for the page’s ccap, or for the all-access ccap/level. If the person has either one, he gets shown the page’s content, and if not, he can get the sales copy with payment form right there.

That way, you’d have to write it just once, put it in the theme’s template for the pages/posts, and have all existing and future pages, protected and sold by it.

https://developer.wordpress.org/themes/template-files-section/post-template-files/
https://developer.wordpress.org/themes/template-files-section/page-template-files/

I hope that helps! :slight_smile:

1 Like