Hi Adrian… OK. This is what I’ve done and it seems to be working.
Step 1
I have 2 separate membership levels: Level 1 and Level 2. Level 1 can only access Level 1, level 2 can only access Level 2. Access to the levels are controlled by categories and tags, so if I either tag a piece of content with the tag ‘level1’ or place a piece of content in ‘level1’ category only Level 1 users will be able to see it.
I create ‘level1’ category and tag, and then ‘level2’ category and tag within WordPress
I’ll go on and explain how you get to sign up users and assign the relevant tags and categories to them.
Step 2
In the theme’s functions.php I added the following code:
—
#—————————————————————–
# Custom Capabilities
#—————————————————————–
add_action (“template_redirect”, “my_custom_capabilities”);
function my_custom_capabilities ()
{
if(has_tag(“level1”) && !current_user_can (“access_s2member_ccap_level1”))
{
header (“Location: “. S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
else if(has_category(“level1”) && !current_user_can (“access_s2member_ccap_level1”))
{
header (“Location: “. S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
else if(has_tag(“level2”) && !current_user_can (“access_s2member_ccap_level2”))
{
header (“Location: “. S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
else if(has_category(“level2”) && !current_user_can (“access_s2member_ccap_level2”))
{
header (“Location: “. S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
}
—
Step 3
I use PayPal Pro Forms to sign up members… Below is an example of the form/code I used in a page for signing up a user for Level 1 and again for level 2.
—
[s2Member-Pro-PayPal-Form level="1" ccaps="level1" desc="£14.95 GBP / Monthly ( recurring charge, for ongoing access )" ps="paypal" lc="" cc="GBP" dg="0" ns="1" custom="yourdomain.com" ta="0" tp="0" tt="D" ra="14.95" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal,visa,mastercard,amex,discover,maestro,solo" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" /]
—
and for level 2
—
[s2Member-Pro-PayPal-Form level="1" ccaps="level2" desc="£14.95 GBP / Monthly ( recurring charge, for ongoing access )" ps="paypal" lc="" cc="GBP" dg="0" ns="1" custom="yourdomain.com" ta="0" tp="0" tt="D" ra="14.95" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal,visa,mastercard,amex,discover,maestro,solo" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" /]
—
Step 4
I created a page called ‘Upgrades’
Step 5
In S2Member>General Options>Membership Options Page, I chose the ‘Upgrades’ page from the ‘Membership Options Page:’ drop down list.
Outcome
So now when a Level 1 member tries to view any content either tagged or categorised as ‘Level 2’, they get sent to the ‘Upgrades’ page… and vice versa.
To Do
Now I’ve just got to work out what to put on the upgrades page to upgrade a membership!!! Might have to do that process manually via payPal to increase the monthly sum and then add the additional tag/category into the user’s profile.
Hope that made sense!