Skip to content

Instantly share code, notes, and snippets.

@GeoffEW
Created October 6, 2016 18:05
Show Gist options
  • Save GeoffEW/14b29959e2eaf6601e4044a2c43a916e to your computer and use it in GitHub Desktop.
Save GeoffEW/14b29959e2eaf6601e4044a2c43a916e to your computer and use it in GitHub Desktop.
Add price to CSV export
<?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