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
The dot notation can be thought of has it relates….
So to answer your question you use:
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:
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 🙂