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.

One Last Try (Custom Capabilities Question)

Home Forums Community Forum One Last Try (Custom Capabilities Question)

This topic contains 0 replies, has 1 voice. Last updated by  Suzan Romanov 3 years, 10 months ago.

Topic Author Topic
Posted: Tuesday Feb 26th, 2013 at 8:34 am #43223

Hey – been working really hard on this and thought I’d try and ask one more time on these boards before trying out another plugin – perhaps wishlist member.

What I need to do is pretty simple… and I have the logic figured out, just hitting a snag.

So here’s what I need to do.

I have 4 products – let’s name then A, B. C, D.

The products can be ordered separately, or in ANY combination.

So for example, a customer can order all 4 or just A, B, and D, or A and D, or just D, or B and C, and so on. I think you get the point.

Each product is on it’s own page. It’s a directory of music industry contacts (like a yellow pages, for the music industry). Really simple.

I have a background in tech, just not an expert. I’ve setup most of this, have the plugin installed and all that.

I just can’t get the stuff to exactly work.

I’ve read up on the s2member forums about custom capabilities so I understand the logic and what the code is supposed to do – i just need it to work.

***another note***

I am going to do the paypal integration manually. As in, when someone orders the product, I will go in and create the users manual, and also manual put the paypal subscription code in.

Thanks you so much if this is your area of expertise and you can lend a helping hand :)

P.S. Below is the code I’ve used inside of the functions.php file. I’m access the file and opening it through my FTP client.

I get an add_action error when I use this and I think it’s because of the add_action line. When i take that add_action line out, i don’t get an error, but the site restrictions don’t seem to work either.

add_action (“wp”, “my_custom_capabilities”);

function my_custom_capabilities ()
{

if(has_tag(“A”) && !current_user_can (“access_s2member_ccap_A”))
{
header (“Location: “. S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}

else if(has_tag(“B”) && !current_user_can (“access_s2member_ccap_B”))
{
header (“Location: “. S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}

else if(has_tag(“C”) && !current_user_can (“access_s2member_ccap_C”))
{
header (“Location: “. S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}

else if(has_tag(“D”) && !current_user_can (“access_s2member_ccap_D”))
{
header (“Location: “. S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}

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.