I followed the instructions from this page:
https://docs.myeventon.com/documentations/how-to-add-additional-fields-to-download-attendees-csv-file/
The two additional fields I added show up in the Column Headers, but the Row Values are populating from somewhere else.
here is the code I am using:
Create a CSV column header for EventOn Additional Checkout Field:
add_filter(‘evotx_csv_headers’, ‘evotx_add_headers’,10,2);
function evotx_add_headers($array, $EVENT){
$array[] = ‘Company’;
$array[] = ‘Position’;
return $array;
Add CSV Row Value for EventOn Additional Checkout Field:
add_filter(‘evotx_csv_row’, ‘evotx_add_row’,10,4);
function evotx_add_row( $array, $tn, $td, $EVENT){
$array[‘company’] = $EVENT->ID;
$array[‘position’] = $EVENT->get_title();
return $array;
}
I am using the Snippet plugin to add the code.
Thanks!
Aug 27,2021 AT 2:04PM - 3 years ago -Hello,
$EVENT->ID and $EVENT->get_title() aren’t correct in this case because they output Event ID and Event Title. Please take a look at
How to get custom values
The second part of the code, pass on the value for each row of attendee. The function get variables $tn (ticket number), $td (ticket data array) and $EVENT (main event class) You can use those to create values for the new field you are adding to each attendee in the CSV file.
$td – the ticket data array holds an array of data for the ticket. You can use print_r($td) within the code to see what information is there and use correct associate path in the array to show those information.
eg. $td[‘oD’][‘ordered_date’] – will get you the date the ticket was ordered.
$td[‘oDD’][‘order_id’] – will give you order ID for the ticket.
So you need to check if $td array actually contains your values: company and position.
Thanks for your reply.
Sorry, I don’t have the PHP programming skills to do this.
Can you suggest someone that could do this for us?
Unfortunately, we unable to help with customizations. You can try submitting a customization request to 3rd party developers via Customize EventON Page.