WooCommerce: Edit “Ship to a Different Address?” @ Checkout

The “Ship to a Different Address?” checkbox displays on the WooCommerce Checkout page and toggles the shipping form. That’s useful when Billing and Shipping addresses are different, so let’s say every B2C requires the double form.

However, the “Ship to a Different Address?” string may be confusing or may need further clarification, as not all customers are created equal. What about “I’d like to define a different shipping address” or “Ship to a different address than the Billing one“?

Either way, editing the string is super easy, so you can change it to whatever you like. Enjoy!

The snippet below allowed me to change “Ship to a different address?” to “Ship elsewhere?” in a matter of seconds. You can edit it to whatever you like.

PHP Snippet: Edit the “Ship to a Different Address?” Checkbox @ WooCommerce Checkout

/**
 * @snippet       Translate "Ship to a Different Address?" @ Checkout
 * @how-to        businessbloomer.com/woocommerce-customization
 * @author        Rodolfo Melogli, Business Bloomer
 * @compatible    WooCommerce 7
 * @community     https://businessbloomer.com/club/
 */

add_filter( 'gettext', 'bbloomer_translate_shippingtodiffaddr', 9999, 3 );
   
function bbloomer_translate_shippingtodiffaddr( $translated, $untranslated, $domain ) {
   if ( ! is_admin() && 'woocommerce' === $domain ) {
      switch ( $untranslated ) {
         case 'Ship to a different address?':
            $translated = 'Ship elsewhere?';
            break;
      }
   }   
   return $translated;
}

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

4 thoughts on “WooCommerce: Edit “Ship to a Different Address?” @ Checkout

  1. Is there a way to swap the checkbox for a title? My aim is to show the shipping address fields all of the time and not allow the customer to toggle. Plus I want to add the title “Shipping address” above the fields.

    1. Jamal, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  2. Hi Rodolfo,
    it’s working but for one language. How to make it tranletable (I’m using WPML)?

    1. Hi Alen! Just replace:

      $translated = 'Ship elsewhere?';

      with:

      $translated = __( 'Ship elsewhere?', 'woocommerce' );

      And now the string should be translatable

Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Your email address will not be published. Required fields are marked *