Add the sample code below to your child theme's functions.php file or in a site specific plugin.
<?php
//* Do NOT include the opening php tag
//* Replace the existing messaging text with something else
function ee_change_expired_tickets_messaging( $translated, $original, $domain ) {
$strings = array(
'We\'re sorry, but all tickets sales have ended because the event is expired.' => 'Unfortunately, all tickets have been sold!',
);
if ( isset( $strings[$original] ) ) {
$translations = &get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}
return $translated;
}
add_filter( 'gettext', 'ee_change_expired_tickets_messaging', 10, 3 );
References: