Created
May 26, 2019 11:10
-
-
Save dangoodman/515a3b9e83974af85a26340aa4137a40 to your computer and use it in GitHub Desktop.
WooCommerce: replace default shipping option title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Paste everything below this line to your child-theme's functions.php file. | |
// Renames any shipping option titled exactly 'Weight Based Shipping' to 'Shipping'. | |
add_filter('woocommerce_shipping_method_add_rate_args', function($rateArgs) { | |
if (isset($rateArgs['label']) && $rateArgs['label'] === 'Weight Based Shipping') { | |
$rateArgs['label'] = 'Shipping'; | |
} | |
return $rateArgs; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment