Posted: August 29, 2017 at 11:28 am
|
Hello, I try to count number of registrations by ticket and status, but its not working with a filter on the TKT_ID $registrations_approved = EEM_Registration::instance()->count(array( array( ‘TKT_ID’ => $ticket->ID(), ‘STS_ID’ => EEM_Registration::status_id_approved ) ), ‘REG_ID’, true); The “$ticket” object works. $registrations_approved = EEM_Registration::instance()->count(array( array( ‘EVT_ID’ => $id_event, ‘STS_ID’ => EEM_Registration::status_id_approved ) ), ‘REG_ID’, true); Do you have a suggestion to fix it ? |
|
Hello, I try to count number of registrations by ticket and status, but its not working with a filter on the TKT_ID
The “$ticket” object works.
Do you have a suggestion to fix it ? |
Hi there, When you say it’s not working, what is happening? I copied your query above and used it within Debug console on a test site replacing A count of 3 is expected for that ticket – http://take.ms/1DtjF What happens on your site? |
|
|
Thx for your reply. Effectively I don’t see a difference between our codes.
Here is the results of this code 781 – Test 24 | 200€ – 0A 0NA |
|
I’m sure to have registration for this tickets. |
Again, that code works fine for me – http://take.ms/Gu1NH
So to confirm, do you have registrations with those statuses on the event? For example here are the registrations for my event – http://take.ms/PeiwS The ‘status’ bar on the left gives a quick reference, green = approved, orange = not approved, blue = pending payment (there is a legend at the bottom of the list) |
|
|
Yes I got registrations on my back-end. I think I find something. My tickets IDs displayed are wrong. For example the first row “$ticket->ID()” displays “781” in place of “747”. If I put directly 747, I find my registrations. I’m looking how to correct this. |
That’s not displaying incorrectly, it’s a different ticket.
Then dump out the Basically step through each step of your code and find where you’re getting the wrong data. |
|
|
The ticket has been duplicated by EventEspresso system security. I have to find the query_param to bring back this locked ticket. |
Ah, yeah I see. You’ll need to remove the default where conditions used on
|
|
|
Thats works 🙂 Many thanks !! You saved me lot of hours. Have a good evening. |
The support post ‘EE4 – Count registration by ticket’ 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.