Created
July 12, 2021 16:56
-
-
Save jorpdesigns/ff46a48ed25dd58644907212b8380c41 to your computer and use it in GitHub Desktop.
Snippet to add description to WooCommerce shipping methods
This file contains hidden or 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 | |
add_filter('woocommerce_cart_shipping_method_full_label', 'custom_shipping_method_label', 10, 2); | |
function custom_shipping_method_label( $label, $method ){ | |
switch ( $method->instance_id ) { | |
case '7': // Replace with your own shipping method id | |
$text = '<br /><small>' . __('Add Method Description') . '</small>'; | |
break; | |
default: | |
$text = ''; | |
} | |
return $label . $text; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment