New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Custom Capabilities as Product Identifiers #202
Comments
This is a great idea for an article. Walking through some examples, like showing how we use "pro,unlimited" might help fill this out a bit. It really shows how you can exploit CCAPS in ways that we really haven't covered in any KB articles yet. |
Worked on this a bit and added the section Using Custom Capabilities as Product Identifiers and Example: Monthly and Yearly Subscription Plans. |
I'm thinking this should probably be a tutorial, with the question summarizing and linking to the tutorial. |
Agree :-) Nice work on this!
It might be a good idea to include a quick example that shows how to convey this to a user. For instance, on your Login Welcome Page you could present something like this...
Or, a more complex/reliable conditional check would be:
|
Great! Thank you!
Great idea! I updated the draft to include these examples. |
Renaming this GitHub issue to Using Custom Capabilities as Product Identifiers and making it a Tutorial; I'll create a new KB Article for the Question How can I differentiate between monthly and yearly subscribers? and reference this one. |
KB Article Creation Checklist
draft
and eitherquestions
ortutorials
draft
label, adddraft-finalized
label)draft-finalized
label, addpending
)pending
label, addpublished
label)Additional TODOs
Additional TODO list items go here.
Using Custom Capabilities as Product Identifiers
Custom Capabilities can be used to restrict access to specific content, however they can also be used as simple identifiers for products or types of memberships. Using Custom Capabilities in this way allows you to make use of existing s2Member functions to create conditionals on your pages that change what is shown to a logged-in member based on the variation of the product they purchased.
Example: Monthly and Yearly Subscription Plans
If you use a single membership level (e.g., Level 1) but offer two different subscription options, e.g., yearly and monthly, you can use Custom Capabilities to identify which users signed up with the monthly plan and which users signed up with the yearly plan by adding a Custom Capability to the Pro-Form shortcode.
In the following example, we have a Pro-Form with two Checkout Options, one for a yearly subscription and one for a monthly subscription. Note the
ccaps=""
shortcode attribute indicatingyearly
vsmonthly
:See also:
When a user signs up with one of the Pro-Forms that contains a Custom Capability (
ccaps=""
), you'll see the Custom Capability associated with their account listed in the Custom Capabilities column on the Users list, allowing you to easily see who signed up for the Monthly plan and who signed up for the Yearly plan:You could then use this information to customize how various content on your site is presented to users who signed up for the Monthly vs Yearly subscription.
For example, on your Login Welcome Page you could make use of conditionals to check the Custom Capability of the user who just logged in and then show specific content to them:
Or, a more complex/reliable conditional check would be:
The text was updated successfully, but these errors were encountered: