Posted: June 25, 2021 at 4:24 am
Hi, |
|
Hi there, We don’t have an option to include this within EE itself but there are filters you can use to add additional columns. Just to confirm, are you aware that ATT_ID is linked to the registration(s) assigned to a transaction, not directly to the transaction? You could also have multiple registrations assigned to a single transaction which may (or may not) mean you have multiple ATT_ID’s to display. |
|
Yeah, I want an Attendee ID for each transaction despite the repetition. I know that an attendee may have multiple registrations so multiple transactions so I want an attendee ID to add for each Transaction. |
|
Ok, but again, a single transaction can have multiple registrations assigned to it which may or may not be assigned to multiple attendees. So it’s not just a case of a repeating attendee ID on multiple transactions, but multiple attendees on single transactions. — We don’t have an example of doing this but there are filters available within Event Espresso to allow you to change the output, meaning you can add additional columns to the transaction list table. I have an example of how to add a column on the Registrations list table here: https://gist.github.com/Pebblo/88f2a0a9213c716e4886a249e7709245 That’ll give you a starting point but you’ll need different filters for that page, the filter uses the current page so any filter with
You can then use the model system to pull all of the details you need for this: https://github.com/eventespresso/event-espresso-core/tree/master/docs/G–Model-System |
|
How to get an Attendee ID for each transaction? |
|
The Attendee ID (ATT_ID) is not assigned to a transaction, the ATT_ID(s) is assigned to each individual registration linked to the transaction. So you need to pull all of the registrations assigned to the transaction and get the ATT_ID from that/those. There is a few different ways to do that, for example:
Returns an array of registrations assigned to the transaction, loop over those to pull the ATT_ID from each. Or you could pull just the value directly from the database, which is a little more performant than the above if all you need is the ATT_IDs and you can use the model system I linked above to do so. If you haven’t read over those docs I recommend you do as they make pulling in various data for Event Espresso fairly straight forward. |
|
Hi Tony, |
|
Is this still in relation to the above custom column or something else?
In short, no, there is not. First, let’s clarify what you are asking for as there seems to be some confusion here.
I’m guessing you are referring to Or are you referring to REG_ID as the ‘attendee_ID’?
In relation to what? The transaction? If this is related to the above you have this backwards, transactions do not relate to the ATT_ID. |
|
ATT_ID is the Attendee transaction ID? |
|
ATT_ID is the ID of the EE_Contact (EE_Attendee) assigned to the registrations on that transaction. There seems to be some confusion here, I’m not sure what an ‘Attende transaction ID’ is? What exactly are you referring to as |
|
No, I see ATT_ID and assuming it the attendee ID. |
|
Ok, so where do you see that currently? As mentioned, the ATT_ID is not directly related to the transaction, it’s related to the registrations linked to that transaction. If you have the transaction object you pull the registrations for it, loop over them and output the ATT_ID for each:
Gives you the ATT_ID for each registration linked to that transaction. You can pull just the ATT_ID and group them in a single query using the models if you already have the Transaction (or the transaction ID).
|
|
Hi Tony, |
|
OK, so that’s different from your original location. We don’t currently have a hook that can be used to display the ATT_ID in that location. |
|
But I think I can use the transaction ID displaying on that page to get the Attendee ID. Am I right? |
|
Sure, that’s how my examples above do it, use the TXN_ID to pull the registrations and then display the ATT_ID(s).
Right now you can’t without modifying core, well technically you can use a filter we have available when override the template that used in that location. Whilst I don’t mind giving you the filter:
And even an example of using it: https://gist.github.com/Pebblo/4703f274437ac01b00ef093caa8646f5 If you can’t work out how to do it from there I’m not going to walk through how to use it as the filter is intended for developers comfortable with PHP, WP and EE. I can’ request we include an additional hook on the default template to include additional details in a future version though. |
|
The support post ‘Attendee ID for each Transaction’ 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.