Skip Navigation

[Resolved] View displaying a list of Users

This support ticket is created 3 years, 2 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 10 replies, has 2 voices.

Last updated by melodyM 3 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#2308115

We are trying to set up a page that will be accessible by admins only that will show a list of all Users that have a custom role called Freelancers. That page is here:

hidden link

The view used on this page is here:

hidden link

I am trying to set up a field for User Name instead of using the First Name and Last Name fields, but User Name is not showing as a field you can use here, either in the Loop Wizard or in Fields and Views. This is very strange to me because User Name is the field I was able to use as the Order by field in the Ordering section at the top of edit View page. Can you let me know if/how I can get the User Name field to display in our View? I'm hoping this will be a simple fix that you can provide.

Then there is another field we would like to have on this page that will likely be more difficult. We have a plugin called YITH Automatic Role Changer for WooCommerce Premium. It is the solution we settled on for assigning roles to users based on their Woocommerce store purchases. We have set up roles to be added to users purchasing certain products on the site that will expire after varying amounts of time. We'd like to have a field on this view that will show that expiration date, and then, if possible, add a filter that will limit the display on this page to only show users whose role is expiring in the next 30 days. I realize this is likely outside the scope of what you can provide for support. But if you have an easy way to accomplish this, let me know. I have a support ticket filed with Yith to determine where they store the Role Expiration Date data. I don't see it as a field on the Edit User page, so I'm not even sure where this data is kept. I will add info about this to this thread after I get an answer from them if this is something you think you can provide easy assistance on. Understood if it is something we'll need to post on your Jobs Board.

#2308169

I figured out the first part of my question that I needed to use the Display Name field. That was easy enough. I was looking for User Name.

So I guess just let me know your thoughts on getting this Role Expiration Date into the View.

#2308219

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

We do not have any exposure about the plugin you mentioned "YITH Automatic Role Changer for WooCommerce" and where they store its related expiration date and other content.

I tried to check the docs but there is no information available where they store date and role information:
- hidden link

As you already know that this is beyond the scope of our support policy but they must be offering some hooks so that you can get the user IDs whose role is expiring in the next 30 days. Can you check with them about this and let me know here.

#2308871

Here is what Yith support said:

-------

The role assignment data is in a postmeta of the order that triggered the role assignment.
he postmeta name is _ywarc_rules_granted. This postmeta contains a serialized array with different informations regarding the role assignment including the expiration date (if any).
I hope this helps.

--------

Is this something that could be pulled into Toolset as a field somehow? I have replied further with Yith to make a feature request that they add a Role Expiration Date field to the user account and make that to where it can be edited from within the Edit User page. I'm thinking if they have it in there, it may be easier to work with for pulling it as a Toolset field somehow. And I think it would be an improvement to the functionality provided by their plugin to make this role assignment expiration date something that site admins can find and modify easily.

I've asked my project manager how much she'd be willing to pay for this if we need to set it up as a post on your Jobs board. I'm awaiting her reply there. But if the above provided information makes it something easy where you could get me the field code I'd need to use that, that would be fantastic. Understood fully if not.

#2310047

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Unfortunately, you can not add a filter for the field that stores the value as serialize array as we can not be able to extract the date from serialize array and build a query.

This needs custom code and that is beyond the scope of our support policy. If you require custom programming for your project , please feel free to contact our certified partners:
- https://toolset.com/contractors/

#2310109

OK, no problem and understood on why. I'll let you know if Yith adds my feature request though. If they do, would that make this doable?

#2310111

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I can not confirm anything without confirmation or analyzing how the content is stored in the database. But if it will be a custom user field that holds the date value I might be able to share workaround using hook.

#2310143

Here was their reply. I'm doubting they will do it from this response.

--------------------------------------

Hi there,
that information cannot be added to a user meta, as a user can receive different roles, so that information should stay in the order. However I will forward your feedback to our developers' team, so, if possible, they can take it into account for a future update.

--------------------------------------

I'll see if my client deems this worth having to pay more to get it custom coded.

#2310163

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I agree, and even if they are agree to add your suggested feature it will not roll out overnight. It may take days or months.

You can check with certified partners:
- https://toolset.com/contractors/

#2310385

Will do. Thanks. Let me get a price ceiling from my client for the most she's willing to pay to get this feature. Basically this report page is intended to give her something so she'll know whose Memberships are close to expiring. I'm not sure how much she uses this on the existing site. If she relies on it heavily, that will mean she'll likely be willing to pay a higher amount to get this done. But if she doesn't use it often, then she may decide to just let it go. We're resolved here now. Thanks.

#2310457

My issue is resolved now. Thank you!