Tips and Tricks HQ Support Portal › Forums › WP eMember › eMember – display conditional content based on multiple membership levels
- This topic has 5 replies, 4 voices, and was last updated 3 years, 10 months ago by wzp.
-
AuthorPosts
-
January 12, 2019 at 7:42 pm #152783ddsaSpectator
Hi,
I’m working on a site site that uses multiple membership levels.
If for example I have 2 membership levels (e.g. ID 2 and 3), how could I show an eMember button to buy membership 3 at a discounted price to those who already have level 2 and not show it to those who already belong to level 3?
I have read the documentation but I could not find a solution for this.
January 13, 2019 at 2:50 am #79060adminKeymasterI think this can be handled using section/partial protection feature:
https://www.tipsandtricks-hq.com/wordpress-membership/how-to-protect-a-section-of-a-post-or-page-88
The following section protection shortcode will hide the button to members of level 3. The other members can see it.
[emember_protected not_for=”3″ do_not_show_restricted_msg=”1″]
//Your button
[/emember_protected]
January 13, 2019 at 1:14 pm #790613ddsaSpectatorThank you admin for your response, I read and I already knew the page.
Using the shortcode indicated the button would be displayed by all users that don’t belong to membership ID 3, while I would need that its display is limited only to users with membership level 2 and not displayed at all to those who have ID 3.
I also tried with nested shortcodes as below, but it doesn’t work.
[emember_protected for=”2″]
[emember_protected not_for=”3″ do_not_show_restricted_msg=”1″]
//Your button
[/emember_protected]
[/emember_protected]
January 14, 2019 at 2:57 am #79062adminKeymasterI see what you mean. The only way to do that is the following:
1) Create a special page where you will have the button for level 2 members who do not have level 3.
2) Apply the standard emember protection to this page for level 2. So only members of level 2 can view this post/page
3) Now add the following shortcode wrapping the button inside the page:
[emember_protected not_for=”3″ do_not_show_restricted_msg=”1″]
//Your button
[/emember_protected]
This will make it so they can only interact with the button if they are not part of level 3.
December 30, 2020 at 10:55 pm #82210clearscopedesignParticipantWe have this exact same need (and I apologize for my other questions about dropping the original membership level when an account is upgraded, as I should have thought to ask this first instead).
We also have the same need stated here: to show particular content to membership level 2, but to hide the content if the member also has membership level 3, for example.
However, as has been explained above, it does not seem to be possible to have nested [emember_protected] shortcodes (only to use the page-level protection in conjunction with a content protection shortcode). But since this is for our renewal page, we are unable to use page-level protection for it.
I then had the thought that maybe we could use the not_for=”” parameter in conjunction with the for=”” parameter together. For example: [emember_protected for=”2″ not_for=”3″]. However, I tested this but it does not seem to work (if the user has level 3, they still end up seeing the content if they also have level 2).
So I am wondering: would it be at all possible to request an implemented update to eMember that would allow for the not_for=”” parameter to take precedence over the for=”” parameter, if both are used? That way, using the not_for=”” parameter would allow for hiding content from a given membership level whenever necessary.
If this would be possible, we would be open to paying for this development if need be.
Otherwise, if that would not be possible, then are there any other options for displaying conditional content based on multiple membership levels, without depending on page-level protection? i.e. to display content to level 2, but to hide that content if the user has level 3?
Thank you kindly for all of your help, and my apologies again for not thinking to ask this from the start.
December 31, 2020 at 6:02 pm #82211wzpModeratorIt would have to be a custom work order. Please request a quote and a developer will get back to you.
- This reply was modified 3 years, 10 months ago by wzp.
-
AuthorPosts
- You must be logged in to reply to this topic.