Support

Home Forums Event Espresso Premium Event Category in the csv all registrations download

Event Category in the csv all registrations download

Posted: February 28, 2017 at 7:25 am

Viewing 12 reply threads


Oguzhan Altun

February 28, 2017 at 7:25 am

Hello,

I’m trying to analyze the events by category, but I couldn’t find a way to add the event categories into the registrations download.

Would there be a simple code to enable this?


Tony

  • Support Staff

February 28, 2017 at 1:58 pm

Hi there,

Something like this: https://gist.github.com/Pebblo/09081bb43fa217b0e83060d151d3eda2

That will add an ‘Event Categories’ column to the csv and add any categories the event has assigned to it within there, the categories are current separated by a space which you may want to change.


Oguzhan Altun

February 28, 2017 at 2:17 pm

hi there,

Thank you for the quick answer. It works, however creates a new problem: with some of the registrations, the author and the categories are pushed by a couple of cells to the right (so while most of them have the Author in AJ then category in AK, a few of them have the same info as of column AN and some of them as of column AS):
https://screencast.com/t/LtgZnAvMVK

I have already 2 other functions in the site specific plugin to add the language tag and the author name to the csv download. Maybe it’s because of how these 3 functions operate together?

https://gist.github.com/altuno/bd583ae4f70354d0961adfa9be8f33ee


Tony

  • Support Staff

February 28, 2017 at 5:50 pm

Hmm, strange.

I can’t see anything in my code that would cause that, it only happens with that additional function?

I’ve updated my code to return null if no categories at set on the event rather than an space, please update and retest as I can not reproduce this.


Oguzhan Altun

March 1, 2017 at 7:30 am

Hi Tony,

I just finished testing each code to see what they will affect. It seems like the issue is not only due to your code, each code creates additional column shifts.

Even when I take out all 3 codes (language (tags) / instructor (event author) / event category), there are some minor column shifts in the download. However as I add each code, each create different column shifts in different registrations for their respective columns.

e.g.: No code: Column shifts in rows 1056, 1075, 1078 etc
Only language tags code: Additional shifts in 972, 976, 1056, etc
Only Event author code: Additional shifts in rows 908, 916, etc
Only Event category code: Additional shifts in rows 45, 61, 62, etc..

How can I proceed?


Tony

  • Support Staff

March 1, 2017 at 7:43 am

e.g.: No code: Column shifts in rows 1056, 1075, 1078 etc

Then the issue is not with any of the code you posted above, have you confirmed you have no other custom code hooking into the CSV?


Oguzhan Altun

March 1, 2017 at 7:47 am

Why? The column shifts with no code are only about 6-7 rows in total, out of about 2500 rows. The additional codes create a lot of extra shifted rows.

These 3 should be the only functions affecting the CSV, you can have a look at the full code in the site specific plugin here:
https://gist.github.com/altuno/4804d0de6a7a2e464558aae6ab7040b7


Tony

  • Support Staff

March 1, 2017 at 7:55 am

Why? The column shifts with no code are only about 6-7 rows in total, out of about 2500 rows. The additional codes create a lot of extra shifted rows.

It doesn’t matter that its only 6-7 rows, there shouldn’t be any, if your columns are shifting without customizations then additional columns will only make that problem worse.

Is there anything different about the values shown in the rows that shift?

These 3 should be the only functions affecting the CSV, you can have a look at the full code in the site specific plugin here

There’s no additional functions altering the CSV in that plugin, but have you confirmed nothing has been added anywhere else, for example the themes functions.php file?


Oguzhan Altun

March 1, 2017 at 8:02 am

Is there anything different about the values shown in the rows that shift?

I did check this, I couldn’t find anything unusual in these rows. Anyway it all seems perfectly fine until the last column for all of the rows.

have you confirmed nothing has been added anywhere else, for example the themes functions.php file?

Yes, I anyway never touch the theme functions file, and the child theme functions file has only a few lines of code not at all related to EE4.

There are some customizations in the events table template file under uploads/espresso/templates, could this have any impact?

Otherwise I have no idea why this issue is happening.


Tony

  • Support Staff

March 1, 2017 at 8:12 am

There are some customizations in the events table template file under uploads/espresso/templates, could this have any impact?

No, not unless your hooking into the CSV from those file which wouldn’t really make sense.

Can you send me a copy of the CSV to support[at]eventespresso.com

Important – please export a new CSV the site and do not open it within excel or similar before sending over. So download the CSV from the site and send that over without opening it up. The reason being is excel can change the formatting of the file, I need the version directly from the site.


Oguzhan Altun

March 1, 2017 at 8:18 am

sure, just sent.


Tony

  • Support Staff

March 10, 2017 at 5:24 am

Thank you.

I have been able to reproduce this on a test site but the cause is unknown. It is not caused by the custom code adding the additional columns, they are a symptom rather than the cause.

I’ve created a ticket for one of our developers to investigate this further.


Oguzhan Altun

March 13, 2017 at 3:54 am

Hi,
OK, look forward to hearing you on this, as my accounting is dependent on this download. Thank you.

Viewing 12 reply threads

The support post ‘Event Category in the csv all registrations download’ 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