Posted: February 8, 2024 at 9:22 pm
I have created functions to filter the Event Listings & Registration Listings in admin by category. Is this possible for transactions? I have found the filter FHEE__Transactions_Admin_Page___get_transactions_query_params which I assume I would use. But I’m not sure what to edit in the $where variable? In Events I used:
and for Registrations I used
Thanks |
|
Hi there, The dot notation can be thought of has it relates…. So to answer your question you use:
So:
Because you’re setting the condition for the term relating to the event relating the registration relating to this transaction. Using the model system to query is a little confusing at first, but it gets easier as you work with it. If you haven’t done so already take a look over the docs here: https://github.com/eventespresso/event-espresso-core/tree/master/docs/G–Model-System |
|
Thanks Tony. I still struggle with the model system, so is it possible to do something like:
I know the Model notation for the author is wrong, but if that was correct, it would only show events with the relevant term by the current user. What I am after is events with the relevant term and events by the current user. In terms of the filter, I am after ‘OR’ rather than ‘AND’. Hopefully that makes sense. How would I achieve this? |
|
Sure it is, the models are really powerful, you can do some pretty complex queries relatively easily. For your request, you need to view: The code, would just be:
Which output this where:
I think that’s what you are looking for, right? |
|
Thanks Tony. I was after either events with the term id, or events created by the current user. With your example and the links you provided my code now works – so posting here in case it helps someone else:
|
|
Awesome, glad it helped 🙂 |
|
The support post ‘Filter the Admin Transactions listing by category’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.