Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Forked from Pebblo/example.php
Last active February 19, 2020 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/3b0c0049c06910680611e22d717ce078 to your computer and use it in GitHub Desktop.
Save joshfeck/3b0c0049c06910680611e22d717ce078 to your computer and use it in GitHub Desktop.
Example of how to alter the MER cart model success message.
<?php
//Alter the successfully added for this event string
function tw_ee_change_cart_result_message($original_text, $ticket_count) {
$cart = EE_Registry::instance()->SSN->cart();
if( $cart instanceof EE_Cart ) {
$output = array();
$tickets_array = $cart->get_tickets();
foreach( $tickets_array as $ticket) {
if($ticket instanceof EE_Line_Item) {
$output[] = $ticket->get('LIN_name');
}
}
$list = implode(', ', $output);
return 'You have ticket(s):<br>' . $list . '<br>in the cart.';
}
return $original_text;
}
add_filter('FHEE__EED_Multi_Event_Registration__get_cart_results_results_message', 'tw_ee_change_cart_result_message', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment