Suppose you need to customize your shipping method descriptions on the WooCommerce cart page. In that case, this code snippet can help you to improve the user experience by conveying clear and compelling messages during checkout.
add_action('woocommerce_after_shipping_rate', 'ts_after_shipping_rate', 20, 2); function ts_after_shipping_rate($method) { // Targeting cart page only: if (!is_cart()) { return; // Exit if not on the cart page } // Display message for flat_rate if ($method->get_method_id() === 'flat_rate') { echo __("<p>Arriving on your chosen date between 9am - 1pm. Perfect for business addresses & special occasions</p>"); } // Display message for free shipping if ($method->get_method_id() === 'free_shipping') { echo __("<p>Free Shipping: Your items will be shipped for free!</p>"); } // Display message for local pickup if ($method->get_method_id() === 'local_pickup') { echo __("<p>Local Pickup: Pick up your items at our location during business hours.</p>"); } }
Output
After a customer views the cart page in WooCommerce, a custom shipping method description will be displayed beside each shipping method.
The default shipping method description that is displayed on the WooCommerce cart page is shown below.
Similarly, if you want to set descriptions from the admin side, you can follow this guide that will add the short descriptions for WooCommerce shipping methods below each title. This will create a new description field on the backend.