I'm trying to translate "Have a coupon?" text in Woocommerce checkout page using this code:
function custom_strings_translation( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'HAVE A COUPON?' :
$translated_text = __( 'TIENES UN CUPÓN?', '__x__' );
break;
}
return $translated_text;
}
add_filter('gettext', 'custom_strings_translation', 20, 3);
But It doesn't work.
Please can someone tell me why?