Posted: October 31, 2019 at 5:00 am
|
Hi there. I saw a few posts but some screenshots were missing, so I’m not sure how to omit fields included with the CSV and rearrange the columns as requested by the client. |
Hi, Customizing the CSV report involves adding a filter function into a small plugin. We have some example code that shows how to specify the fields to include and have them in the order specified columns. You’ll find that example here: You can add the modify the above into a functions plugin. This guide shows how to add a functions plugin to your site |
|
|
Thanks Josh. This is very helpful. I have been able to edit the CSV but am not able to get all the fields to come over. Is there a list of fields somewhere I can reference? I am able to get some but not many. Can I also bring over details like venue details? |
Hi there, If you remove you function and export a CSV, the column names used as the fields available on the CSV by default, you need to set that exactly as they appear in the column name for them to filter correctly in your code. Or you can output My preferring method of doing that is to use Kint and then on say line 10 of that function use
Yes, you can bring over whatever details you prefer, but you’ll need to get comfortable using our models: https://github.com/eventespresso/event-espresso-core/tree/master/docs/G–Model-System You would then just add the values to the |
|
|
Thanks Tony! I checked and fixed the fields that weren’t appearing and they are now working. Much appreciated. I’m a little out of my lane with the coding that looks to be required for the G-Model-System. Is there a step-by-step maybe that shows how and where to put the code and then how to call that code (if I’m wording it right) from the customizations.php plugin so that the fields are pulled over and added to the CSV? And/or… |
|
Hi again. Poking around, I saw some code from Josh here: https://gist.github.com/joshfeck/fe12aa10c1e8deef04607189b69636d3 That adds my Venue! 🙂 Is it possible to use that code to pull over other data? I have: |
Not really as it’s expected whoever would be using the models would be familiar with PHP, I can help give you some pointers though. With Josh’s function, inside the condition HERE, ACF basically uses normal WP custom fields on the Event and you can pull the value using various methods. So I assume you’ve set those values on the event itself? If so you can do something something like:
Within that condition above. That will use the That help? |
|
The support post ‘Customizing CSV output’ 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.