Easily Change ‘Shipping Costs’ to ‘Delivery’ in WooCommerce
How to change shipping costs text in woocommerce;
Replace shipping costs with delivery in wordpress;
Customize shipping costs label in woocommerce;
Change shipping costs wording on woocommerce cart;
Edit shipping costs text to delivery in wordpress;
Woocommerce change shipping costs to delivery;
Modify shipping costs text in wordpress;
Update shipping costs label to delivery in woocommerce;
How to rename shipping costs in woocommerce;
Change shipping costs text to delivery in wordpress;
Explanation
If you're looking to change the wording from "Shipping Costs" to "Delivery" in your WooCommerce store, here's a simple way to do it.
What This Code Does:
- It replaces the text "Shipping Costs" with "Delivery" throughout your WooCommerce site.
- The code also changes the label "Shipping" to "Delivery" in both the cart and checkout pages.
How It Works:
- The first function checks if the text is part of WooCommerce and then swaps "Shipping Costs" for "Delivery".
- The second function specifically targets the cart and checkout pages to change "Shipping" to "Delivery".
By adding this code, your customers will see "Delivery" instead of "Shipping Costs" or "Shipping" when they shop on your site. This can help clarify the process if you prefer using the term "Delivery".
Code
<?php
// Function to change the 'Shipping Costs' text to 'Delivery' in WooCommerce
function wp_dudecom_change_shipping_costs_text( $translated_text, $text, $domain ) {
// Check if the text domain is WooCommerce
if ( 'woocommerce' === $domain ) {
// Replace 'Shipping Costs' with 'Delivery'
if ( 'Shipping Costs' === $text ) {
$translated_text = 'Delivery';
}
}
return $translated_text;
}
add_filter( 'gettext', 'wp_dudecom_change_shipping_costs_text', 20, 3 );
// Function to change the 'Shipping' text to 'Delivery' in WooCommerce cart and checkout
function wp_dudecom_change_shipping_label( $label ) {
// Replace 'Shipping' with 'Delivery'
if ( 'Shipping' === $label ) {
$label = 'Delivery';
}
return $label;
}
add_filter( 'woocommerce_shipping_package_name', 'wp_dudecom_change_shipping_label' );
add_filter( 'woocommerce_cart_shipping_method_full_label', 'wp_dudecom_change_shipping_label' );
?>
Instructions
File Location: functions.php or a custom plugin file
Prerequisites:
- Ensure WooCommerce is installed and activated on your WordPress site.
Implementation Steps:
- Log in to your WordPress admin dashboard.
- Navigate to Appearance > Theme Editor if you are editing the
functions.php
file of your active theme. Alternatively, navigate to Plugins > Plugin Editor if you are using a custom plugin file. - Locate and open the
functions.php
file or your custom plugin file where you want to add the code. - Copy and paste the provided code snippet into the file.
- Save the changes to the file.
- Clear your site cache if you have a caching plugin active, to ensure the changes take effect immediately.
- Visit your WooCommerce store's cart and checkout pages to verify that "Shipping Costs" and "Shipping" have been replaced with "Delivery".
If you encounter any issues or need further assistance with this implementation or more advanced functionality, consider reaching out to wp-dude.com for professional help.