Snippet

Easily Change ‘Shipping Costs’ to ‘Delivery’ in WooCommerce

How to change shipping costs text in woocommerceReplace shipping costs with delivery in wordpressCustomize shipping costs label in woocommerceChange shipping costs wording on woocommerce cartEdit shipping costs text to delivery in wordpressWoocommerce change shipping costs to deliveryModify shipping costs text in wordpressUpdate shipping costs label to delivery in woocommerceHow to rename shipping costs in woocommerceChange 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

1<?php 2// Function to change the 'Shipping Costs' text to 'Delivery' in WooCommerce 3function wp_dudecom_change_shipping_costs_text( $translated_text, $text, $domain ) { 4 // Check if the text domain is WooCommerce 5 if ( 'woocommerce' === $domain ) { 6 // Replace 'Shipping Costs' with 'Delivery' 7 if ( 'Shipping Costs' === $text ) { 8 $translated_text = 'Delivery'; 9 } 10 } 11 return $translated_text; 12} 13add_filter( 'gettext', 'wp_dudecom_change_shipping_costs_text', 20, 3 ); 14 15// Function to change the 'Shipping' text to 'Delivery' in WooCommerce cart and checkout 16function wp_dudecom_change_shipping_label( $label ) { 17 // Replace 'Shipping' with 'Delivery' 18 if ( 'Shipping' === $label ) { 19 $label = 'Delivery'; 20 } 21 return $label; 22} 23add_filter( 'woocommerce_shipping_package_name', 'wp_dudecom_change_shipping_label' ); 24add_filter( 'woocommerce_cart_shipping_method_full_label', 'wp_dudecom_change_shipping_label' ); 25?>

Instructions

File Location: functions.php or a custom plugin file

Prerequisites:

  • Ensure WooCommerce is installed and activated on your WordPress site.

Implementation Steps:

  1. Log in to your WordPress admin dashboard.
  2. 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.
  3. Locate and open the functions.php file or your custom plugin file where you want to add the code.
  4. Copy and paste the provided code snippet into the file.
  5. Save the changes to the file.
  6. Clear your site cache if you have a caching plugin active, to ensure the changes take effect immediately.
  7. 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.