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
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x