Webcrashpilot,
my config : wp 5.4.1 , wc 4.1.1 , storefront theme 2.5.6
I have still the same problem (Switzerland – French part) with my config and I resolve this right now before a new update of woocommerce :
1. I installed the plugin : WooCommerce Checkout Field Editor and add a new <select> with state ( with the name : Canton ) for each billing and shipping method ( this is automatic, without coding )
2. Put in the theme child functions.php the above code :
add_filter( 'gettext', 'my_text_strings', 20, 3);
function my_text_strings( $translated, $text, $domain ) {
$translated = str_ireplace( 'facultatif', 'obligatoire', $translated );
return $translated;
}
This is a method to change the text ( here in French ). In English is optional / required.
OK, with this method, we don’t see the apostrophe (*) but we have possibility to inform the customer this is a required cell.
Info for developers : I put a lot of possibilities, try to gettext everywhere and see in the upside code : it is impossible to change the normal text (facultatif). It’s put out automatic the ‘(‘ and ‘)’. This is reason I put only \facultatif\ between the two ‘ ‘.
The code is located as : <span class="optional">(optional)</span>
Hope this could be help
Regards
-
This reply was modified 4 years, 6 months ago by myBuzz. Reason: add name of select Canton in order of state
-
This reply was modified 4 years, 6 months ago by myBuzz. Reason: add translated text in English