Copying WooCommerce files to your child theme directory is not the recommended method for this problem. Consider using a filter as explained here:
https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/
Your filter and function go in functions.php for your child theme.
@lorro,
Thanks for your help.
I now see that this is the line of code I need to edit,
$field_label = sprintf( _x( 'Billing %s', 'Billing FIELDNAME', 'woocommerce' ), $field['label'] );
All I need is to replace the word Billing with another word, but I am not sure how to do this in the functions.php file.
I’m sorry I gave a wrong answer. Its not functions.php for this.
You’ll need to load Loco Translate:
https://wordpress.org/plugins/loco-translate/
“translate” includes using other words in the same language.
Dashboard > Loco Translate > Plugins > WooCommerce > your-language > Edit
Sync
Filter for:
Billing %s [Billing FIELDNAME]
then in the translation box, change to your chosen words, eg:
Charging %s
Save
If you have a custom template, the string might be at:
Dashboard > Loco Translate > Themes > your-theme-name > your-language > Edit
Hi,
Add this code to your child theme’s functions.php and change Mybilling to whatever you want.
function my_woocommerce_add_error( $error ) {
return str_replace('Billing','Mybilling',$error);
}
add_filter( 'woocommerce_add_error', 'my_woocommerce_add_error' );
@menakas
Thank you so much that worked like a Charm.
@lorro,
Thank you for this suggestion, I will definitely give it a try as I am sure I will need to do more stuff like this again soon.
Appreciate your care (:
Hi @elmalak,
Glad 🙂 Will you mark this post as resolved?