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?
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.
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.
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.
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.
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.
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.
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?
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.