Last active
November 30, 2016 22:02
-
-
Save mnelson4/5f800aaffedc9c794b3f to your computer and use it in GitHub Desktop.
Filtering Ticket name and description in SPCO in EE4.6.23
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
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); |
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
This is how it displayed for me: https://docs.google.com/file/d/0B2KCao4zFjaxVEdTRElzdmJUaGM/edit?usp=drivesdk