Skip Navigation

[Resolved] Controlling content access for a certain membership group

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Author
Posts
#918221

Hi,

Currently, we have several Woo Membership levels, standard and free.

The below code ensures that only standard users see a download button on a page, any non-members of the site are shown a join now link instead.

The issue that we have is that a 'free member' of the site is actually logged in, of course, they do not see the download button, but they are shown the Join Now link, however, this does not appear to work for them when they click it. I know the link works because when I log out the site and visit the same page I'm able to click the Join Now link and I'm taken to the required modal box.

I presume this issue is something to do with another level of conditions adding, and that because we have a user that is logged in, but not a standard membership user, somehow there is an issue with the link working correctly.

What I'm looking for some help with is allowing a member-free user to be able to also click on the Join Us link and for it to work. Are you able to assist with the code for this? Or have I overlooked something else?

[wpv-conditional if="( '[wpv-current-user]' eq '' )"]
<p class="lead">To access resources please join now or log in.</p>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-current-user]' ne '' )"]
[wcm_restrict plans="member-standard"]
[wpv-woo-buy-options add_to_cart_text='Add to basket']
[/wcm_restrict]
[wcm_nonmember plans="member-standard"]
<p class="lead">To access resources please join now.
[/wcm_nonmember]
[/wpv-conditional]

Many thanks
Dan

#918348

The issue that we have is that a 'free member' of the site is actually logged in, of course, they do not see the download button, but they are shown the Join Now link, however, this does not appear to work for them when they click it.
May I log in as a Free Member User and see this link in the browser? I will activate private reply fields here. Please let me know how to find the link on your site once I have logged in.

#918848
Screen Shot 2018-06-28 at 10.58.13 AM.png

I don't see a problem with the link, I see a problem with the modal content. When I'm logged in, there is no modal content. You can see here in the screenshot, the div#modalJoin does not exist in the DOM. When I'm not logged in, the modal content exists. I think you have a logic issue somewhere else preventing the modal content from being rendered for this login status or role.

#919996

Quite possibly, as this is a new role that's been created.

So the end game is to allow the member-free membership role access to this as well.

Can I ask for your assistance is achieving this? with some details so that if it comes up again we can learn from the process.

Thanks

#920511

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Luke,

As Christian is currently on vacation. I will be handling this.

So your issue here is that you have a user role called Free Member and some users are assigned to this. However you want those members to have access to a join now button ?

This join now button i presume is connected to a registration form of some sort that would allow them to change their membership correct?

Could you update the user account to admin so that I can take a look. As christian mentioned the modal is not even on the page.

It could be that there is some code that is there that only allows the modal to appear for logged out users.

Thanks,
Shane

#920684

Thank you, the user has been upgraded as requested. If you could list any changes you make that would be great so a/ we know how to approach this in the future and b/ with have a record to track back against if there are any issues.

Many thanks

#921317

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Luke,

Thank you.

Could you let me know which role is having the issue ?

Thanks,
Shane

#922336

Its the members-free role.

Thanks
Dan

#924359

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screen Shot 2018-07-12 at 3.26.28 PM.png

Hi Luke,

Sorry for the delayed response . I went to check on this but i'm not seeing a members-free role when i'm trying to create a new user. See screenshot.

Thanks,
Shane

#924371

Hi,

Its not a WordPress role, its a role created using WooCommerce Memberships, which is used with WooCommerce subscriptions.

We just need to understand that why that when logged in as the free user given above, the user can not click said link - where as if you are loggged in as a standard user, then you are able to do so.

We presume it is something to do with access control governed by TS, potentially via code on the content template page.

Cheers

#924736

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Luke,

I think there is something wrong with the layout itself.

I tried to modify it and save it but its not saving due to some json error.

Could you try re-creating the Layout and see if that helps?

Thanks,
Shane

#924837

Hi,

Can you confirm which layout you refer to? These are inherited from the old designer and I don't really want to do anything that could impact the usability of the overall site and bring it to its knees.

Thks

#924893

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Luke,

No worries,

Would you be more comfortable if I took a local copy of the site so that I can test this and let you know ?

Thanks,
Shane

#948458

Yes, I think that would be best.

Just a quick thought, at the moment this link is trying to open a modal box, instead, if we used a direct url link to an actual page I presume that would resolve the issue?

#950365

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Luke,

A direct link would work best. Sometimes modals can break even if there is a simple javascript error on the page. In this case there is no error but it still doesn't work.

Would you prefer to try it like this ?