Multiple ccaps per page

Hello,

I am selling an online course with six modules. I would like to sell it as a complete package and individual modules.For every page in the first module I used the ccaps (course,module_1) Will this give access to everyone who has purchased the course but also the users who have only purchased module 1?

No: access to such pages will require that the user has BOTH ccaps.

Can S2member do what I am asking for?

Yes, but I would suggest using roles instead of ccaps because roles are hierarchical. (That isn’t mandatory, but it is what I’d do.) Then you can use dripping to control who sees what when. See this: https://s2member.com/kb-article/s2drip-shortcode/

1 Like

You can also do it with the CCAPs (course, module1), but you’ll need to use conditionals ([s2If]). You CAN use OR with [s2If].

For example:

[s2If current_user_can(access_s2member_ccap_course) OR current_user_can(access_s2member_ccap_module1)]

Page content here.

[/s2If]
1 Like

Awesome! That’s what I was looking for, I will try that. Thanks!

After adding the conditionals, if users do not have permission to access the page it shows a blank page with the menu bar. I want them to be redirected to the membership options page. Is this still possible?

Not really. What you could do is show the code for the Membership Options Page as conditional content for those who don’t meet the criteria. Something like this:

[s2If current_user_can(access_s2member_ccap_course) OR current_user_can(access_s2member_ccap_module1)]

Page content here for those who meet the requirements

[else]
  [_s2If !current_user_can(access_s2member_ccap_course) AND !current_user_can(access_s2member_ccap_module1)]
MOP content here for those who don't meet the requirements.
  [/_s2If]
[/s2If]
1 Like

thanks! ill try that

wouldn’t i need to use OR instead of AND?

N[quote=“optic, post:10, topic:1445”]
wouldn’t i need to use OR instead of AND?
[/quote]

Not in this case. We are using a NOT operator. If someone has the course CCAP and doesn’t have module1 they would be included in the group if you used OR. That means they’d see both pieces of content: the protected content and the content you are showing to people who don’t mean the criteria.