Created
May 18, 2023 22:28
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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