I want to be able to add an "li" tag within my product title. To achieve this in a user friendly way I wrote a code which changes the character "-" to an "li" tag. But currently the html does not have an effect on the "order-details-table" (which for example appears when you finished ordering). Is there another filter to add the html globaly so it changes "-" to "li" every time the title occures? --> I updated my code and the html now appeares everywhere, only the following problem is remaining:
In the backend however the html gets added, but gets shown as plain text, so it does not have an effect. Is there also a solution to this problem?
What the product title looks like at the moment --> the html gets interpreted as normal text
add_filter( 'the_title', 'custom_the_title', 10, 2 );
add_filter( 'woocommerce_cart_item_name', 'custom_the_title', 20, 3);
add_filter( 'woocommerce_order_item_name', 'custom_the_title' );
function custom_the_title( $title){
$title = str_replace( '-', '<li>', $title );
$title = str_replace( '.', '</li>', $title );
return $title;
}
Thanks a lot for your help, and greetings from Austria! Samuel