If you want to display a personalized message on the thank you page in WooCommerce for a free shipping method, then the code snippet provided below can be utilized for customization purposes.
add_filter( 'woocommerce_thankyou_order_received_text', 'ts_change_order_received_text', 20, 2 ); function ts_change_order_received_text( $text, $order ) { if( $order->get_shipping_method() == 'Free shipping' ) { $text .= ' <div class=\"outside-delivery-checkout\"><strong>'. __("PLEASE NOTE", "woocommerce") . ':</strong><br />'.__("Your shipping destination is outside of our normal delivery area. Our team will call you to calculate an additional fuel surcharge.", "woocommerce") . '</div>'; } return $text; }
Output
This code shows a custom message on the order received page for the ‘Free Shipping’ method that informs customers of additional delivery charges for out-of-delivery area shipping destinations.
Similarly, we can also customize the woocommerce thankyou page by changing the page title, personalizing the page, and in many other ways.