Skip Navigation

[Resolved] Add user's camps to "My Account" page?

This support ticket is created 4 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.

Our next available supporter will start replying to tickets in about 1.79 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 26 replies, has 2 voices.

Last updated by Christian Cox 4 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1705269

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.

#1705611
block-navigation.png
author-filter.png

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.

#1708763

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?

#1709049

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.

#1712299
Skærmbillede-2020-07-20-kl.-09.51.55.jpg

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.

#1712317

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.

#1712787

Okay I can check if you provide login credentials in the private reply fields here.

#1713059
Screen Shot 2020-07-20 at 4.00.09 PM.png

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.

#1716211

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.

#1716213

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"]

#1716295

Okay thanks, I will take a look.

#1716297

Thanks so much

#1716347

Can you share a login for an author User with some Camps published so I can test something? Private reply fields are active here.

#1716595

That's odd, the private fields were not included in your reply. Can you try once again?

#1719579

Hi Christian,

Did you receive the message with the private login?