Created
October 6, 2016 18:05
-
-
Save GeoffEW/14b29959e2eaf6601e4044a2c43a916e to your computer and use it in GitHub Desktop.
Add price to CSV export
This file contains 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 | |
/* Tribe, add price to ticket in CSV export */ | |
function tribe_add_price_to_ticket ( $value, $item, $column ) { | |
if ( 'ticket' != $column ) return $value; | |
$product = wc_get_product ($item['product_id']); | |
return $value . ' - Price: $' . $product->price; | |
} | |
// just add this filter for csv export | |
function tribe_add_price_csv ( $event_id ) { | |
add_filter( 'tribe_events_tickets_attendees_table_column', 'tribe_add_price_to_ticket', 10, 3 ); | |
} | |
add_action( 'tribe_events_tickets_generate_filtered_attendees_list', 'tribe_add_price_csv' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment