Skip to content

Instantly share code, notes, and snippets.

@rickgregory
Created April 12, 2024 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rickgregory/f95bfc49c31fb44aea059b7fac9e566e to your computer and use it in GitHub Desktop.
Save rickgregory/f95bfc49c31fb44aea059b7fac9e566e to your computer and use it in GitHub Desktop.
<?php
/* Changes the word Shipping to Delivery in the Woocommerce cart. Credit to Loictheaztec https://stackoverflow.com/a/53016991 */
add_filter('woocommerce_shipping_package_name', 'change_shipping_text_to_delivery', 20, 3 );
function change_shipping_text_to_delivery( $sprintf, $i, $package ) {
$sprintf = sprintf( _nx( 'Delivery', 'Delivery %d', ( $i + 1 ), 'delivery packages', 'woocommerce' ), ( $i + 1 ) );
return $sprintf;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment