Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to Add Custom Message on the Thank You Page by shipping method in WooCommerce?

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.

How to Add Custom Message on the Thank You Page by shipping method in WooCommerce?

Similarly, we can also customize the woocommerce thankyou page by changing the page title, personalizing the page, and in many other ways.

Browse more in: Code Snippets, WooCommerce How Tos, WooCommerce Tutorials

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible.

Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

By using our site, you acknowledge that you have read and understood our Privacy Policy and Terms & Conditions.