Support

Home Forums Event Espresso Premium Event Registration Export to Excel – EE4

Event Registration Export to Excel – EE4

Posted: July 24, 2016 at 7:02 pm

Viewing 11 reply threads


Elizabeth

July 24, 2016 at 7:02 pm

Can we customize this report? We really only need a few pieces of information. If you aren’t good with excel, it’s difficult for people to get rid of the garbage in it.

One piece of good information is “did they apply a discount code” and some of our peeps miss that sometimes because it’s WAAAAAY down on the end and not seen.

So anyway, I’d just like Amount Paid, Complete or incomplete, first name, last name, email address and promotions. That’s it.


Tony

  • Support Staff

July 25, 2016 at 4:11 am

Hi Dorian,

You can use the function available here:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/admin/registration_report_limit_columns_shown.php

You set only the columns you want to display within the CSV (use the name of the column at the top of the CSV for each line, currently it does First Name, Last Name, Email and a custom question called radio as an example), all others will be excluded.

Place that function within either your child themes functions.php file or a Custom Functions Plugin


Elizabeth

July 25, 2016 at 5:39 pm

How do I find out what the email address and promotions value is?


Elizabeth

July 25, 2016 at 5:42 pm

Where is the file in EE4?


Tony

  • Support Staff

July 26, 2016 at 4:09 am

How do I find out what the email address and promotions value is?

The values to add to the above function to include them within the CSV? You look within the CSV and find the column name.

For example, the function I linked you to includes the First Name by setting the column name shown here – http://take.ms/TkroS

You add each column name you want to include within that function above.

Promotions would be ‘Transaction Promotions’.

Where is the file in EE4?

Which file? The CSV’s are built dynamically from the details from the database so you don’t see a list of columns within any EE file.


mm_georgia_1

July 26, 2016 at 10:01 am

Thanks! I understand now 🙂


mm_georgia_1

July 26, 2016 at 10:06 am

Looking at the CSV I see where:

Last Name[ATT_lname] has [ATT_lname] but Transaction Status does not have anything like that.

So below, how would I add Transaction Status:

<?php
//only include these 4 columns in the registration CSV output
add_filter( ‘FHEE__EE_Export__report_registrations__reg_csv_array’, ‘espresso_reg_report_filter_columns’, 10, 2);
function espresso_reg_report_filter_columns( $csv_row, $registration_db_row ) {
$filtered_csv_row = array_intersect_key(
$csv_row,
array_flip( array(
__( ‘First Name[ATT_fname]’, ‘event_espresso’ ),
__( ‘Last Name[ATT_lname]’, ‘event_espresso’ ),
__( ‘Email Address[ATT_email]’, ‘event_espresso’ ),
‘radio’,//custom question’s admin label, doesn’t need to be translated. note though: if you ever change the custom question’s admin label, this code will need to be adjusted
) ) );
return $filtered_csv_row;
}


Tony

  • Support Staff

July 26, 2016 at 10:15 am

Last Name[ATT_lname] has [ATT_lname] but Transaction Status does not have anything like that.

It’s the whole column name, so the Last Name column uses:

'Last Name[ATT_lname]' not just '[ATT_lname]'

The transaction status column name is just 'Transaction Status'

So I you would add that to the list:

array_flip( array(
__( 'First Name[ATT_fname]', 'event_espresso' ),
__( 'Last Name[ATT_lname]', 'event_espresso' ),
__( 'Email Address[ATT_email]', 'event_espresso' ),
'Transaction Status',
) ) );

If you run your site in a different language you’ll want to wrap the fields within the __() function, like so:

__( 'Transaction Status', 'event_espresso' )


mm_georgia_1

July 26, 2016 at 10:18 am

We just us US


mm_georgia_1

July 26, 2016 at 10:20 am

So the brackets do really mean anything? I assumed they pointed to the database value.


Tony

  • Support Staff

July 26, 2016 at 10:23 am

__() is a translation function.

It takes a string to translate and a text domain used within the function to determine where the transactions comes from.

Take a look here:

https://codex.wordpress.org/Function_Reference/_2


Tony

  • Support Staff

July 26, 2016 at 10:24 am

Oh you mean the Square brackets? They show the DB column name for some values.

You just need the full column names (whatever they may be within the CSV your viewing) within the function above.

Viewing 11 reply threads

The support post ‘Event Registration Export to Excel – EE4’ 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.

Event Espresso