Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created May 18, 2023 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/71b17ac6164873b3f1b846671ef56d83 to your computer and use it in GitHub Desktop.
Save Pebblo/71b17ac6164873b3f1b846671ef56d83 to your computer and use it in GitHub Desktop.
Example of how to add an additional 'Ticket Base price' column into the CSV.
<?php
add_filter(
'FHEE__EventEspressoBatchRequest__JobHandlers__RegistrationsReport__reg_csv_array',
'tw_ee_csv_add_ticket_base_price',
20,
2
);
function tw_ee_csv_add_ticket_base_price(
array $csv_row,
$reg_row
) {
$reg = EEM_Registration::instance()->get_one_by_ID($reg_row['Registration.REG_ID']);
$ticket = $reg->ticket();
$ticket_base_price[esc_html__('Ticket Base Price', 'event_espresso')] = $ticket->base_price()->amount();
$csv_row = EEH_Array::insert_into_array(
$csv_row,
$ticket_base_price,
'Ticket Name',
false
);
return $csv_row;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment