Hi there,
Is it possible to add an overview of the Camps that the user created under "My Account"? Or is it possible to create a page where the 2 different user roles can see these things:
HOST USER
- My Camps (camps that the host user created)
- Profile (name, address, contact info etc.)
- Orders
- Loguout
CUSTOMER USER
- Profile (name, address, contact information etc)
- Orders (what camps they bought)
- Logout
I use the "If menu" plugin that Waqar recommended earlier.
Hello, I assume you are referring to the My Account Page created automatically by WooCommerce, and I assume Camp is a custom post type. If that is correct, you can edit the My Account page in wp-admin > Pages and add other content to the page, including a View of Camp posts. You cannot easily modify the content generated by the woocommerce_my_account shortcode - that would require custom programming - but the rest of the main page content outside the woocommerce_my_account shortcode is editable. You could edit the page and add a View of Camps filtered by post author, where the author is the current logged-in User. To add this Query Filter, select the top-level View block in the block navigation menu (see block-navigation.png). Then in the block configurations, you can find the Query Filter panel. Add a post author Query Filter configured to display posts where the post author is the same as the current logged-in User (see author-filter.png).
Let me know if you have questions about this and I can give you more details.
Hi Christian,
Thanks for your help! Quick question though:
If I insert the Query Filter - won't it be visible to both the Host and the Customer user?
I would like the "My Camps" field to only shop up on the Host profile - is this possible?
It sounds like you need two things:
1. In the My Account page, you need a way to show or hide a View of Camps, depending on the logged-in User's role
2. In that View, you need a way to filter the Camp results so that only the logged-in User's Camps are displayed
For #1, Toolset offers a conditional block that can be used to show and hide content based on some conditional logic. We have information about the conditional block available here:
https://toolset.com/course-lesson/using-toolset-conditional-block/
One of the conditions you can test is "Current User Role", and I think that will accomplish what you want. If you'd like more details about how to use the conditional block and I can split that off into a separate ticket. Let's use this ticket to discuss the Query Filter in more detail if you need more information about that.
Hi Christian,
I tried following your guide but I need more help. I don't see the options you showed me on the screenshots. Is it possible for you to login to my site and help with the setup?
I added the conditional block with a view of camps in it and set up some rules in the view and in the Query Filter - but the Query filters are totally different from what you sent me. See the screenshot please.
I already send the login information a few times in the other tickets. Let me know if you need anything.
Now I found the same filters as you have and followed your screenshots, but it still doesn't work. If you can please login and check I would be very happy. I'm sure I set it up wrong.
Okay I can check if you provide login credentials in the private reply fields here.
You mentioned that you want to display the View only for the Host User role. Have you set up the "Host User" role yet? I don't see a similar custom role in Access Control. For now, I have configured the conditional to display only for Administrators (see the screenshot), but once you set up the Host role you will need to change the static value from "administrator" to match the slug of the host role. Your Query Filter seems to be correct, I don't think you need to change anything there.
hi Christian,
Yes the Host user role should be created. All Host users should be created in the back end as an Author - that was the closest I thought I could get to the access the Host shall have. Is this wrong? Let me know.
Hi Christian,
I just checked and I don't see the camps I created as an Admin but only this code:
[wpv-view name="my-account-host-camps" cached="off"]
Okay thanks, I will take a look.
Can you share a login for an author User with some Camps published so I can test something? Private reply fields are active here.
That's odd, the private fields were not included in your reply. Can you try once again?
Hi Christian,
Did you receive the message with the private login?