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
* @community https://businessbloomer.com/club/
*/
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>)';
}
Hi, I was excited to see your elegant solution. It doesn’t seem to work, but maybe I’m just not understanding how to format/syntax the label in order to make the hyperlink work
WordPress (6.3.1)
WooCommerce version: 8.0.3
Hey Richard, did you use my exact code or did you edit it?