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