Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/dh_432dct/themedev.thepixelpixie/wp-c0nt3nt/plugins/gravityforms/common.php on line 1273

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/dh_432dct/themedev.thepixelpixie/wp-c0nt3nt/plugins/gravityforms/common.php on line 1310

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/dh_432dct/themedev.thepixelpixie/wp-c0nt3nt/plugins/gravityforms/common.php on line 1314

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/dh_432dct/themedev.thepixelpixie/wp-c0nt3nt/plugins/gravityforms/common.php on line 1342

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/dh_432dct/themedev.thepixelpixie/wp-c0nt3nt/plugins/gravityforms/common.php on line 3464

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/dh_432dct/themedev.thepixelpixie/wp-c0nt3nt/plugins/gravityforms/common.php on line 3471

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/dh_432dct/themedev.thepixelpixie/wp-c0nt3nt/plugins/gravityforms/common.php on line 3484

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/dh_432dct/themedev.thepixelpixie/wp-c0nt3nt/plugins/gravityforms/common.php on line 3972
Change "Shipping and Handling" text in WooCommerce | Pixie Nerd Theme
Go to the top

Change "Shipping and Handling" text in WooCommerce

I recently had a client for whom I had added a separate line to their WooCommerce checkout process specifically for handling fees (they needed it displayed and calculated separately from the actual shipping charges). But now that meant that one line was labeled “Shipping and Handling” and then another line was named “Handling”. This was rather confusing. So I needed a function that changed that text without hacking the core files of WooCommerce. Here’s the solution if you find you need it. Note: This is not an uncommon need in WooCommerce so this function is probably found in many places all over the web. I’m keeping it here as much for my own future reference as to provide it to you.

Remember that this code goes inside your theme functions.php file.

// change shipping and handling text to "Delivery Charges"

add_filter('gettext', 'translate_reply');
add_filter('ngettext', 'translate_reply');

function translate_reply($translated) {
$translated = str_ireplace('Shipping and Handling', 'Delivery Charges', $translated);
return $translated;
}

Just change ‘Delivery Charges’ to whatever you want the line to be titled, and you’re done!