Skip to content

Instantly share code, notes, and snippets.

@mnelson4
Last active November 30, 2016 22:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnelson4/5f800aaffedc9c794b3f to your computer and use it in GitHub Desktop.
Save mnelson4/5f800aaffedc9c794b3f to your computer and use it in GitHub Desktop.
Filtering Ticket name and description in SPCO in EE4.6.23
function ee_revise_registration_checkout_line_item_desc( $original_description, $line_item, $options ) {
$datetime_names = array();
if( $line_item->ticket() instanceof EE_Ticket ) {
foreach( $line_item->ticket()->datetimes() as $datetime ) {
$datetime_names[] = $datetime->get_dtt_display_name(true);
}
}
return sprintf( __( ' for "%1$s", for datetime(s): %2$s', 'event_espresso' ),
$line_item->ticket_event_name(),
implode(", ", $datetime_names ) );
}
add_filter ('FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__desc', 'ee_revise_registration_checkout_line_item_desc', 10, 3);
@mnelson4
Copy link
Author

@joshfeck
Copy link

You can use the false param e.g. $datetime->get_dtt_display_name(false); so it will always print the date time. When it's set to true, it will use the actual name of the date time if a name is input for that date time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment