Created
March 16, 2017 14:58
-
-
Save dangoodman/00e2699474631553c27cb62e82d71a13 to your computer and use it in GitHub Desktop.
WooCommerce: Hide shipping option labels
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 theme's functions.php file. | |
// Hide shipping option labels. | |
// Example: | |
// — Regular Shipping: $20 => $20 | |
// — Express Shipping: $30 => $30 | |
// — Free Shipping => Free | |
add_filter('woocommerce_cart_shipping_method_full_label', function($label) { | |
@list(, $price) = explode(':', $label); | |
return isset($price) ? ltrim($price) : 'Free'; | |
}, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment