Posted: July 19, 2023 at 11:06 pm
There used to be a feature or code that showed how many seats belonged to a single purchaser. It would appear as; [A Name] [B Name] https://my.bincdn.com/1117/ee4-full-seats.jpg I think it used to appear sometime like that back in 2016 EE4 version. Then it was changed to: [A Name] [A Name] [B Name] https://my.bincdn.com/1117/ee4-total-seats.jpg Currently, the second one is how EE4 is displaying, but how do I re-create the first one? |
|
Hi there, That is not a feature I can recall being added to Event Espresso, are you sure that wasn’t something custom? The code to display “X / Y” for registrations was added in 2015, before that was just the ID. We have never referred to the REG_count or REG_total as ‘seats’ because we cover way more use cases than those for ‘seats’ so its a term we don’t use. Your screenshot is only displaying primary registrants but we display them all. I’m guessing this was something custom, either via translating the |
|
It definitely could have been something custom. I just cannot recall ever adding it. I was just wondering if it was possible to do it, even if it was custom, and where I might find it to actually do it. |
|
Tony, You gave me the hint with %1$s / %2$s though it turned out to be %s of %s as I needed to make the modification on the Event Check-in page. With some help from ChatGPT, I was able to modify the code to go from: 1 of 2 |
|
🙂 Got to love a bit of ChatGPT. I’m curious as to what it gave you for this, mind sharing? (You can add it in a private reply and I’ll delete it again if preferred) |
|
Sure Tony. I’m happy to share with others if there is nothing against the policy. If it is, feel free to delete this response. So in the specific request for this code code, she prints out the Event Check-In page which her staff uses as a check off list to understand how many seats her customers have purchased, but having so many rows in the table was taking up a lot of space and printing out too much paper, so she was wanting a single name of the customer and how many seats they purchased. As a warning to those who wish to use the code, it is an EE4 core file that was modified so I must put the warning out there to anyone who wishes to use the code: FOR EVENT ESPRESSO 4 USE ONLY. PLEASE DO NOT ATTEMPT THIS ON A LIVE PRODUCTION WEBSITE UNLESS YOU KNOW WHAT YOU ARE DOING. File: EE_Event_Registrations_List_Table.class.php I combed over the Event Check-In code and knew these functions were important:
Just had to figure out how to use them to produce my desired result! This is where ChatGPT was most instrumental in helping me figure out what the code was to skip the row. I could skip the column by returning an empty string but it wasn’t removing the row!
Fortunately, EE4 devs were generous to return the higher number in the group first. The other section of the code that was changed:
And of course, since this condensed the seats, EE4 stars the first ticket purchase which is no longer relevant, so this code can be commented out:
I do hope this feature can be built into EE4 to give a more condensed version of the registration / event check-in list page, but this seems to have done the trick for my needs! |
|
In addition for the printing code (ctrl+p on the Event Check-In page), this cuts out all the unnecessary bits that you need on a regular desktop or mobile phone, but not when printing. Again, AS A WARNING TO ANYONE USING THIS CODE, you will need to add this to a functions.php file, which EE4 Support Staff is very adamant about NOT editing. Thus, they always provide this link, as tinkering in the functions.php can break your website: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ I urge you to stay out of your theme’s functions.php as any theme updates will remove all your hard work or just break your website, so do yourself a huge favor and create a custom functions file or download a plugin. There are several available with some designed to ensure that even if there is something wrong with your code, your website won’t break! PLEASE DO NOT TINKER WITH THE BACKEND OF CODE YOU DO NOT UNDERSTAND. So once you’ve downloaded a custom functions.php plugin that allows you to add code, you will want to hide everything that is irrelevant when printing, and this will cut out about 3 or 4 pages and modify the backend page to be more print-friendly with focus solely on the Event Title and the table contents. My client has more custom requests where she asks questions upon registration and I’ve hijacked the page to show the answers to those questions in the table to help her understand her customers better (specifically replacing the email and tkt option section with a phone nuumber and a seating notes section), so it is more than just the name she needs from this page, so this may not be a use-case for everyone. But for anyone who might need the code for printing a backend page in the WordPress admin:
|
|
And a last comment on a comment: // Check if count is equal to group_size and skip the row if they are equal This is supposed to say: // Check if count is equal to group_size and skip the row if they are NOT equal We only care about the TOTAL NUMBER of tickets/seats purchased matching the current count and will display the row IF THEY MATCH. |
|
The support post ‘Condensed Seating Code’ 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.