Are 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:
Here are the steps you need to follow:
- Log into your WordPress site and access the Dashboard as the admin user.
- 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.
- Add the following code to the php file:
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]However, you will notice that the shipping label on the order received page has not been changed:
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]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
- WooCommerce Redirect After Logout [Ultimate Guide]
- WooCommerce Redirect After Checkout : Redirect to Custom Thank You Page
- How to Change Currency Symbol In WooCommerce
- How to Change WooCommerce Checkout Labels
- How to Set Up Homepage in WooCommerce Storefront
- How to Install WooCommerce Storefront Step By Step [Complete Guide]
- How to Add Custom WooCommerce Payment Icons Checkout Page
- How to Set Up WooCommerce Checkout Field Placeholder
- How to Move WooCommerce Checkout Field
- How to Add Currency to WooCommerce [Custom Currency]
- How to Style WooCommerce Checkout Page
- How to Add Checkout Phone Number Validation WooCommerce
- How to Set Up WooCommerce Bitcoin Checkout
- How to Add Date Field to Checkout In WooCommerce
- WooCommerce Mobile Checkout Optimization Quick Guide
- How to Change Add to Cart Button to Read More WooCommerce
- How to Temporarily Disable Checkout In WooCommerce
- How to Create Custom Order Received Page WooCommerce
- How to Change Apply Coupon Button Text In WooCommerce
- How to Customize WooCommerce Product Pages