Skip to content

Instantly share code, notes, and snippets.

@mtruitt
Created December 21, 2017 20:30
Show Gist options
  • Save mtruitt/00069ecea81c2c2231f2199bd1565166 to your computer and use it in GitHub Desktop.
Save mtruitt/00069ecea81c2c2231f2199bd1565166 to your computer and use it in GitHub Desktop.
WooCommerce - Change Shipping Text to Shipping & Handling
<?php
add_filter( 'woocommerce_shipping_package_name' , 'woocommerce_replace_text_shipping_to_delivery', 10, 3);
/**
*
* Function to replace shipping text to shipping & handling text
*
* @param $package_name
* @param $i
* @param $package
*
* @return string
*/
function woocommerce_replace_text_shipping_to_delivery($package_name, $i, $package){
return sprintf( _nx( 'Shipping &amp; Handling', 'Shipping &amp; Handling %d', ( $i + 1 ), 'shipping packages', 'woocommerce' ), ( $i + 1 ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment