Let’s say you want to help customers understand your shipping rates and benefits right on the WooCommerce Cart and Checkout pages, by adding a link to each shipping option (e.g. “View shipping FAQ“).
As you can see from the first and second screenshot below, if you enter any HTML within the WooCommerce shipping zone -> shipping method settings, this will be stripped out, and HTML tags such as hyperlinks won’t work.
So, how can we add a clickable text link to each shipping method, given that we can’t use the WooCommerce settings? Well, as usual, a quick PHP snippet can help us with that. Enjoy!
PHP Snippet: Add Text Hyperlink to Shipping Methods @ WooCommerce Cart & Checkout
/**
* @snippet Add HTML to Shipping Rate Label @ WooCommerce Cart & Checkout
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @compatible WooCommerce 8
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/
add_filter( 'woocommerce_cart_shipping_method_full_label', 'bbloomer_shipping_method_suffix' );
function bbloomer_shipping_method_suffix( $label ) {
return $label . ' (<a href="">shipping FAQ</a>)';
}