As you may or may not know, if you are creating ticket types as variable WooCommerce products the name of the variation is placed between parentheses (brackets) next to the name of the product (as a ticket). But, this will not only display the name of variation but also a label of the variation. Now, although this might seem helpful for some, one of our customers had, for example, several dates selectable where he placed as a label of the variation "Choose your date" which is pretty logical. However, when he placed a ticket type element on the ticket template he got something like this: Name of the Ticket (Choose your date: Sat 29th April 2017). Obviously, the Choose your date part here is not needed and customer wanted to have only the date.
Now, if you ever found yourself in this kind of situation, you can use the following code and add it to your theme's (or preferably child theme's) functions.php file:
add_filter('tc_ticket_type_element', 'tc_ticket_type_element_modify', 10, 1);
function tc_ticket_type_element_modify($title){
return str_replace('choose-your-date: ', '', $title);
}
Of course, you should replace 'choose-your-date:' with your own value.
Additionally, if you need to replace several values, you can use following code:
function tc_ticket_type_element_modify($title){
return str_replace(array('choose-your-date: ', 'something else', 'and something else'), '', $title);
}
So, if you need this kind of modification, now you can have it pretty simple.