If you’re building an eCommerce site for a pickup only shop, you’ll notice that the checkout form by default will have the H3 heading “Billing & Shipping” which is slightly erroneous and should instead just read “Billing”. This guide shows you how you can change this default “Billing & Shipping” heading text and replace it with just “Billing”. In this specific example, “Billing & Shipping” is replaced with “Billing Details”.
/**
* Snippet Name: WooCommerce Change "Billing & Shipping" Heading On Checkout Page
* Snippet Author: ecommercehints.com
*/
add_filter( 'gettext', 'ecommercehints_change_billing_shipping_heading', 10, 3 );
function ecommercehints_change_billing_shipping_heading( $translated, $untranslated, $domain ) {
if ( !is_admin() && $domain === "woocommerce" ) {
if ( $translated == 'Billing & Shipping' ) { // The exact text to replace (the existing heading)
$translated = 'Billing Details'; // The new text
}
}
return $translated;
}