How to Change Shipping Label WooCommerce

WooCommerce Change Shipping LabelAre you looking for a way to change the shipping label in your WooCommerce store? If you are familiar with WooCommerce, you know that it is a great free e-commerce solution. It is packed with many features that allow you to sell anything online.

If you need something extra from WooCommerce, you often find WooCommerce does not give you all that you need. For example, if you want to change the shipping label.

What stands out is that WooCommerce is developed with extendibility in mind, similar to the modularity of WordPress. You can use custom code or plugins to make changes to your site.

WooCommerce Change Shipping Label

In this post, we will share how you can change the shipping label on the cart and checkout pages. We will also show you how to change this label on the order received page.

We recommend that you create a child theme before you proceed. This will ensure that your changes are not lost during an update.

Let us see how you can achieve this.

Steps to Change the Shipping Label

By default, this is how the shipping label is displayed:shipping label

Here are the steps you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file where we will add the function that will change the shipping label in your WooCommerce store.
  3. Add the following code to the php file:
[php] add_filter( ‘woocommerce_shipping_package_name’ , ‘njengah_replace_text_shipping_to_delivery’, 10, 3);

function njengah_replace_text_shipping_to_delivery($package_name, $i, $package){

    return sprintf( _nx( ‘Delivery’, ‘Delivery %d’, ( $i + 1 ), ‘shipping packages’, ‘put-here-you-domain-i18n’ ), ( $i + 1 ) );

}

[/php]
  1. This code will change the shipping label on the cart and checkout page. This is the outcome:delivery

However, you will notice that the shipping label on the order received page has not been changed:order received

To change the shipping label on this page, add the following code in the functions.php file:

[php]

add_filter(‘gettext’, ‘translate_reply’);

add_filter(‘ngettext’, ‘translate_reply’);

function translate_reply($translated) {

$translated = str_ireplace(‘Shipping’, ‘Delivery’, $translated);

return $translated;

}

[/php]

This is the outcome:new label

Conclusion

In this post, we have shared how you can change the shipping label programmatically.

However, you should be careful when handling the functions.php file. This is because if you make a mistake it will throw an error.

If you have any problem implementing the code, please consider contacting a qualified WordPress developer.

Similar Articles

  1. WooCommerce Redirect After Checkout : Redirect to Custom Thank You Page