I am trying to change a text in the WooCommerce checkout page from Shipping to Delivery from Your Order Section. I tried to open t
I can see this is an older thread but it had the answer I was looking for. I extended the solution from @Rahul S so the one function could translate multiple strings if desired. It it a revision of a function I use for Event Calendar by ModernTribe. Being in the US I used "Shipping and Handling" in place of "Delivery."
add_filter('gettext', 'zgwd1010_woo_translations', 20, 3);
add_filter('ngettext', 'zgwd1010_woo_translations', 20, 3);
function zgwd1010_woo_translations( $translation, $text, $domain ) {
// Put your custom text here in a key => value pair
$custom_text = array(
'Shipping:' => 'Shipping and Handling:',
);
if( array_key_exists( $translation, $custom_text ) ) {
$translation = $custom_text[$translation];
}
return $translation;
}