-
-
Save joshfeck/3b0c0049c06910680611e22d717ce078 to your computer and use it in GitHub Desktop.
Example of how to alter the MER cart model success message.
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 | |
//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